Skip to content

Bump cryptography from 44.0.1 to 44.0.2 in the production-dependency-patches group #253

Bump cryptography from 44.0.1 to 44.0.2 in the production-dependency-patches group

Bump cryptography from 44.0.1 to 44.0.2 in the production-dependency-patches group #253

Workflow file for this run

name: Build and Publish Docker Containers
on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- v[0-9]+.[0-9]+.[0-9]+
permissions:
contents: read
id-token: write
env:
BUILDX_NO_DEFAULT_ATTESTATIONS: 1 # Reduce warnings from Docker Buildx
GAR_LOCATION: us
GAR_REPOSITORY: remote-settings-prod
GCP_PROJECT_ID: moz-fx-remote-settings-prod
jobs:
server_container:
env:
DOCKERHUB_IMAGE_NAME: mozilla/remote-settings
GAR_IMAGE_NAME: remote-settings
runs-on: ubuntu-latest
environment: build
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Enable multiplatform builds
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: "--debug" # Enable detailed logging
- name: Set tag version
run: echo "LATEST_TAG=$(git describe --tags --abbrev=4)" >> "$GITHUB_ENV"
- name: Create version.json
run: |
# create a version.json per https://github.com/mozilla-services/Dockerflow/blob/main/docs/version_object.md
printf '{\n "commit": "%s",\n "version": "%s",\n "source": "%s",\n "build": "%s"\n}\n' \
"$GITHUB_SHA" \
"$LATEST_TAG" \
"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" > ./version.json
# Show complete version.json for debugging
cat ./version.json
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKERHUB_IMAGE_NAME }}
${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.GAR_REPOSITORY }}/${{ env.GAR_IMAGE_NAME }}
# https://github.com/marketplace/actions/docker-metadata-action#tags-input
tags: |
type=raw,value=latest
type=raw,value=${{ env.LATEST_TAG }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Authenticate on GCP
id: gcp_auth
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: ${{ vars.GCPV2_GITHUB_WORKLOAD_IDENTITY_PROVIDER }}
- name: Login to GAR
uses: docker/login-action@v3
with:
registry: ${{ env.GAR_LOCATION }}-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.gcp_auth.outputs.access_token }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push to GAR and Docker Hub
uses: docker/build-push-action@v6
with:
context: .
file: RemoteSettings.Dockerfile
target: production # See multi-stage build
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha # Load cache from GitHub Actions
cache-to: type=gha,mode=max # Save cache to GitHub Actions
cronjobs_container:
env:
GAR_IMAGE_NAME: remote-settings-core-cronjobs
LATEST_TAG: "" # Set after checkout step
runs-on: ubuntu-latest
environment: build
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set tag version
run: echo "LATEST_TAG=$(git describe --tags --abbrev=4)" >> "$GITHUB_ENV"
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.GAR_REPOSITORY }}/${{ env.GAR_IMAGE_NAME }}
tags: |
type=raw,value=latest
type=raw,value=${{ env.LATEST_TAG }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Authenticate on GCP
id: gcp_auth
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: ${{ vars.GCPV2_GITHUB_WORKLOAD_IDENTITY_PROVIDER }}
- name: Login to GAR
uses: docker/login-action@v3
with:
registry: ${{ env.GAR_LOCATION }}-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.gcp_auth.outputs.access_token }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: cronjobs/
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha # Load cache from GitHub Actions
cache-to: type=gha,mode=max # Save cache to GitHub Actions
browser_test_container:
env:
GAR_IMAGE_NAME: remote-settings-browser-tests
LATEST_TAG: "" # Set after checkout step
runs-on: ubuntu-latest
environment: build
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set tag version
run: echo "LATEST_TAG=$(git describe --tags --abbrev=4)" >> "$GITHUB_ENV"
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.GAR_REPOSITORY }}/${{ env.GAR_IMAGE_NAME }}
tags: |
type=raw,value=${{ env.LATEST_TAG }}
type=raw,value=latest
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Authenticate on GCP
id: gcp_auth
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: ${{ vars.GCPV2_GITHUB_WORKLOAD_IDENTITY_PROVIDER }}
- name: Login to GAR
uses: docker/login-action@v3
with:
registry: ${{ env.GAR_LOCATION }}-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.gcp_auth.outputs.access_token }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: browser-tests/
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha # Load cache from GitHub Actions
cache-to: type=gha,mode=max # Save cache to GitHub Actions