Skip to content

Commit

Permalink
Migrate Docker container publishing workflow from Circle to GHA (#478)
Browse files Browse the repository at this point in the history
* Migrate container publishing to GHA

* Delete all remaining CircleCI workflow files
  • Loading branch information
grahamalama authored Oct 24, 2023
1 parent 1cfb199 commit ed8e579
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 157 deletions.
99 changes: 0 additions & 99 deletions .circleci/config.yml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Build and Publish Docker Containers

on:
push:
branches:
- main
tags:
- "*"

jobs:
server_container:
runs-on: ubuntu-latest
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: 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: Docker metadata
uses: docker/metadata-action@v5
with:
images: mozilla/remote-settings
tags: |
type=raw,value=${{ env.LATEST_TAG }}
type=raw,value=latest
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: RemoteSettings.Dockerfile
target: production
push: true
tags: ${{ steps.meta.outputs.tags }}

integration_test_container:
runs-on: ubuntu-latest
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: Docker metadata
uses: docker/metadata-action@v5
with:
images: mozilla/remote-settings-integration-tests
tags: |
type=raw,value=${{ env.LATEST_TAG }}
type=raw,value=latest
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: IntegrationTests.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
58 changes: 0 additions & 58 deletions bin/deploy-dockerhub.sh

This file was deleted.

0 comments on commit ed8e579

Please sign in to comment.