Package for prod #667
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: Package for prod | |
env: | |
DEFAULT_YARI_BRANCH: "main" | |
on: | |
workflow_dispatch: | |
inputs: | |
notes: | |
description: "Notes" | |
required: false | |
default: "" | |
yari_branch: | |
description: "Yari branch to build against" | |
required: false | |
default: ${DEFAULT_YARI_BRANCH} | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: "0 */24 * * *" | |
workflow_call: | |
secrets: | |
GCP_PROJECT_NAME: | |
required: true | |
PING_URL_ISSUES: | |
required: false | |
WIP_PROJECT_ID: | |
required: true | |
jobs: | |
everything: | |
environment: prod | |
permissions: | |
contents: read | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Set up node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Set env | |
run: | | |
echo "YARI_BRANCH=${{ inputs.yari_branch || env.DEFAULT_YARI_BRANCH }}" >> $GITHUB_ENV | |
- name: Authenticate with GCP | |
uses: google-github-actions/auth@v2 | |
with: | |
token_format: access_token | |
service_account: deploy-prod-updates@${{ secrets.GCP_PROJECT_NAME }}.iam.gserviceaccount.com | |
workload_identity_provider: projects/${{ secrets.WIP_PROJECT_ID }}/locations/global/workloadIdentityPools/github-actions/providers/github-actions | |
- name: Setup gcloud | |
uses: google-github-actions/setup-gcloud@v2 | |
- name: Do it! | |
env: | |
UPDATE_URL: https://updates.developer.mozilla.org | |
BUCKET: updates-prod-developer-mozilla-e2b95ed55d379b1a | |
GCS_BUCKET: updates-prod-mdn | |
run: | | |
${{ github.workspace }}/scripts/run.sh | |
- name: Ping | |
env: | |
ping_url: ${{ secrets.PING_URL }} | |
if: ${{ env.ping_url != '' }} | |
run: curl ${{ env.ping_url }} |