Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #232
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR CI/CD | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened, closed] | |
branches: | |
- master | |
jobs: | |
build: | |
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | |
name: Build App | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2.6.0 | |
- name: Restore Gradle cache | |
id: cache | |
uses: actions/cache@v2.1.7 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- uses: actions/setup-java@v2 | |
with: | |
distribution: 'adopt' | |
java-version: 11 | |
- name: Build Apps | |
run: ./gradlew :app:client:assemble | |
- name: Upload Static Web App Artifact | |
uses: actions/upload-artifact@v2 | |
id: upload | |
with: | |
path: app/client/build/dist/js/WEB-INF/ | |
name: static-web-app | |
if-no-files-found: error | |
deploy: | |
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | |
name: Deploy Staging | |
runs-on: ubuntu-latest | |
needs: [ build ] | |
steps: | |
- name: Download Static Web App Artifact | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
name: static-web-app | |
path: dist/ | |
- name: Prepare Env | |
uses: DamianReeves/write-file-action@v1.2 | |
with: | |
path: dist/application.env | |
contents: | | |
API_URL=https://kamp.azurewebsites.net | |
write-mode: overwrite | |
- name: Deploy Azure Static Web App | |
uses: Azure/static-web-apps-deploy@v0.0.1-preview | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APP_API_TOKEN }} | |
repo_token: ${{ github.token }} | |
action: "upload" | |
app_location: "/dist" | |
undeploy: | |
if: github.event_name == 'pull_request' && github.event.action == 'closed' | |
runs-on: ubuntu-latest | |
name: Undeploy Staging | |
steps: | |
- name: Close Pull Request | |
id: closepullrequest | |
uses: Azure/static-web-apps-deploy@v0.0.1-preview | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APP_API_TOKEN }} | |
action: "close" |