build(deps): Bump com.squareup.okio:okio from 2.9.0 to 3.4.0 in /server #1590
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: Server CI | |
on: | |
push: | |
paths: | |
- ".github/workflows/**" | |
- "docs/**" | |
- "api/**" | |
- "server/**" | |
- "tools/**" | |
pull_request: | |
branches: [master] | |
paths: | |
- ".github/workflows/**" | |
- "docs/**" | |
- "api/**" | |
- "server/**" | |
- "tools/**" | |
jobs: | |
test: | |
name: Test server on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: "12.0.2" | |
architecture: x86 | |
- uses: gradle/wrapper-validation-action@v1 | |
- run: ./gradlew test | |
working-directory: server | |
deploy_to_appengine_staging: | |
# Only push if tests are successful | |
needs: test | |
name: Deploy Server to App Engine (Staging) | |
# SECURITY: This job uses staging secrets; do not enable it for | |
# pull requests. | |
if: | | |
github.repository == 'WorldHealthOrganization/app' && | |
github.ref == 'refs/heads/master' && | |
github.event_name == 'push' | |
runs-on: ubuntu-latest | |
env: | |
LOG_URL: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: "12.0.2" | |
architecture: x86 | |
- uses: google-github-actions/setup-gcloud@v0.2.0 | |
- run: gcloud components install beta app-engine-java && gcloud components update | |
- name: Setup GCP Credentials | |
shell: bash | |
run: | | |
echo "$BASE64_KEY_JSON" | base64 --decode > $APPLICATION_CREDENTIALS_GPG | |
gpg --quiet --batch --yes --decrypt --passphrase="$KEY_PASSPHRASE" --output $APPLICATION_CREDENTIALS $APPLICATION_CREDENTIALS_GPG | |
rm $APPLICATION_CREDENTIALS_GPG | |
gcloud auth activate-service-account --key-file=$APPLICATION_CREDENTIALS | |
env: | |
BASE64_KEY_JSON: "${{ secrets.APP_ENGINE_DEPLOY_STAGING_SVCACCT_JSON }}" | |
KEY_PASSPHRASE: "${{ secrets.APP_ENGINE_DEPLOY_STAGING_SVCACCT_PASSPHRASE }}" | |
APPLICATION_CREDENTIALS: "${{ runner.temp }}/gcp.json" | |
APPLICATION_CREDENTIALS_GPG: "${{ runner.temp }}/gcp.json.gpg" | |
- run: gcloud info | |
- id: newDeployment | |
name: Track Environment Deployment Status | |
uses: actions/github-script@v2 | |
with: | |
previews: flash,ant-man | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const { data: deployment } = await github.repos.createDeployment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: context.sha, | |
auto_merge: false, | |
environment: 'appengine-staging', | |
required_contexts: [], | |
}); | |
await github.repos.createDeploymentStatus({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
deployment_id: deployment.id, | |
state: 'in_progress', | |
log_url: process.env.LOG_URL, | |
}); | |
return deployment.id; | |
- shell: bash | |
run: ./bin/deploy-server.sh who-mh-staging | |
working-directory: server | |
- name: Destroy GCP Credentials File | |
run: rm $APPLICATION_CREDENTIALS | |
if: ${{ always() }} | |
env: | |
APPLICATION_CREDENTIALS: "${{ runner.temp }}/gcp.json" | |
- name: Revoke GCP Credentials | |
run: gcloud auth revoke | |
if: ${{ always() }} | |
- uses: actions/github-script@v2 | |
name: Finalize Deployment Status | |
if: ${{ always() }} | |
with: | |
previews: flash,ant-man | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
await github.repos.createDeploymentStatus({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
deployment_id: '${{steps.newDeployment.outputs.result}}', | |
state: '${{job.status}}' === 'success' ? 'success' : 'failure', | |
log_url: process.env.LOG_URL, | |
environment_url: '${{job.status}}' === 'success' ? 'https://console.cloud.google.com/appengine?project=who-mh-staging&serviceId=default' : '', | |
auto_inactive: '${{job.status}}' === 'success' | |
}); |