Bumped version to 20240910.1 #45
Workflow file for this run
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: BMO Deployment | |
on: | |
push: | |
tags: | |
- release-** | |
env: | |
IMAGE_NAME: mozilla-bteam/bmo | |
GAR_LOCATION: us | |
GCP_PROJECT_ID: moz-fx-bugzilla-prod | |
GAR_REPOSITORY: bugzilla-prod | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build the Docker image | |
run: docker build -t bmo --target base . | |
- name: Create directory for artifacts | |
run: mkdir build_info | |
- name: Install docker-compose | |
run: sudo apt update && sudo apt install -y docker-compose | |
- name: Build version.json | |
run: | | |
docker-compose -f docker-compose.test.yml run --no-deps --name version_json --entrypoint true bmo.test | |
docker cp version_json:/app/version.json build_info/version.json | |
docker rm version_json | |
- name: Build push data | |
run: | | |
docker-compose -f docker-compose.test.yml run --no-deps --name push_data bmo.test push_data | |
docker cp push_data:/app/build_info/blog.push.txt build_info/blog.push.txt | |
docker cp push_data:/app/build_info/markdown.push.txt build_info/markdown.push.txt | |
docker cp push_data:/app/build_info/bug.push.txt build_info/bug.push.txt | |
docker cp push_data:/app/build_info/email.push.txt build_info/email.push.txt | |
docker cp push_data:/app/build_info/tag.txt build_info/tag.txt | |
docker cp push_data:/app/build_info/wiki.push.txt build_info/wiki.push.txt | |
docker rm push_data | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Build Info | |
path: build_info | |
deploy: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: docker/setup-buildx-action@v2 | |
- id: gcp-auth | |
name: Google authentication | |
uses: google-github-actions/auth@v2 | |
with: | |
token_format: "access_token" | |
service_account: artifact-writer@${{ env.GCP_PROJECT_ID }}.iam.gserviceaccount.com | |
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_POOL_PROJECT_NUMBER }} | |
- name: Log in to the container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.GAR_LOCATION }}-docker.pkg.dev | |
username: oauth2accesstoken | |
password: ${{ steps.gcp-auth.outputs.access_token }} | |
- name: Build and push image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
target: base | |
tags: | | |
${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.GAR_REPOSITORY }}/bmo:${{ github.ref_name }} | |
push: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |