Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update azure-static-web-apps-gray-ocean-0501b9d0f.yml #45

Merged
merged 9 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Azure Static Web Apps CI/CD

on:
push:
branches:
- develop
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- develop

jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
env:
GA: ${{ vars.GA_ID_DEV }}
ROOT_URL: ${{ vars.ROOT_URL_DEV }}
SEARCH_SERVICE: ${{ vars.SEARCH_SERVICE_URL_DEV }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
lfs: false
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_AGREEABLE_STONE_0B04A730F }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "/" # App source code path
api_location: "" # Api source code path - optional
output_location: "/dist" # Built app content directory - optional
###### End of Repository/Build Configurations ######

close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_AGREEABLE_STONE_0B04A730F }}
action: "close"
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
env:
GA: ${{ vars.GA_ID_TEST }}
ROOT_URL: ${{ vars.ROOT_URL_TEST }}
SEARCH_SERVICE: ${{ vars.SEARCH_SERVICE_URL_TEST }}
steps:
- uses: actions/checkout@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ node_modules
npm-debug.log
gulp-config.json
config.conf
dist
14 changes: 13 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ let config = {
},
dist: {
cssPath: './bar/css',
jsPath: './bar/js'
jsPath: './bar/js',
deployPath: './dist',
},
compilerPath: './src',
packagesPath: './node_modules',
Expand Down Expand Up @@ -180,6 +181,17 @@ gulp.task('js-inject-vars', (done) => {
// All js-related tasks
gulp.task('js', gulp.series('es-lint', 'js-build-header', 'js-build-header-full', 'js-inject-vars'));

gulp.task('move-homepage', () => {
return gulp.src(['./index.html', './robots.txt'])
.pipe(gulp.dest(config.dist.deployPath));
});

gulp.task('move-assets', () => {
return gulp.src('./bar/**/*')
.pipe(gulp.dest(`${config.dist.deployPath}/bar`));
});

gulp.task('move-deploy', gulp.series('move-homepage', 'move-assets'));

//
// Rerun tasks when files change
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"prebuild": "npm install",
"build": "gulp default"
"build": "gulp default && gulp move-deploy"
},
"devDependencies": {
"@babel/cli": "^7.17.3",
Expand Down
4 changes: 3 additions & 1 deletion src/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
set -o nounset
set -x
cd "$(dirname "$0")"
source ../config.conf
if [ -f ../config.conf ]; then
source ../config.conf
fi
NOW=$(date +"%s")

# Create temp files:
Expand Down
Loading