chore(ci): migrate to github actions #1
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: Docker Build Workflow | |
on: | |
push: | |
pull_request: | |
concurrency: | |
group: ${{ github.event.repository.name }}-ci-${{ github.event.pull_request.number }} | |
cancel-in-progress: true | |
env: | |
WORKING_DIR: /tmp/docker-gst-ci | |
jobs: | |
init: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up workspace | |
run: mkdir -p ${{ env.WORKING_DIR }}/workspace | |
- name: Save current date as environment variable | |
run: echo "DATE=$(date -u +"%Y-%m-%dT%H-%M-%SZ")" > ${{ env.WORKING_DIR }}/workspace/env-vars | |
- name: Upload workspace artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: workspace | |
path: ${{ env.WORKING_DIR }}/workspace | |
amd64-build: | |
needs: init | |
runs-on: ubuntu-amd64-8core | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download workspace artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: workspace | |
- name: Load environment variables | |
run: source workspace/env-vars | |
- name: Login to DockerHub | |
run: echo "${{ secrets.DOCKER_PWD }}" | docker login -u "${{ secrets.DOCKER_LOGIN }}" --password-stdin | |
- name: Build and push AMD64 images | |
run: ./push-latest.sh | |
- name: Upload AMD64 docker tag | |
uses: actions/upload-artifact@v4 | |
with: | |
name: workspace | |
path: workspace | |
arm64-build: | |
needs: init | |
runs-on: ubuntu-arm64-8core | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download workspace artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: workspace | |
- name: Load environment variables | |
run: source workspace/env-vars | |
- name: Login to DockerHub | |
run: echo "${{ secrets.DOCKER_PWD }}" | docker login -u "${{ secrets.DOCKER_LOGIN }}" --password-stdin | |
- name: Build and push ARM64 images | |
run: ./push-latest.sh | |
- name: Upload ARM64 docker tag | |
uses: actions/upload-artifact@v4 | |
with: | |
name: workspace | |
path: workspace | |
aggregate-images: | |
needs: | |
- amd64-build | |
- arm64-build | |
runs-on: ubuntu-amd64-8core | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download workspace artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: workspace | |
- name: Load environment variables | |
run: source workspace/env-vars | |
- name: Verify AMD64 and ARM64 tags | |
run: | | |
cat workspace/docker-tag-basename-x86_64.txt | |
cat workspace/docker-tag-basename-aarch64.txt | |
- name: Login to DockerHub | |
run: echo "${{ secrets.DOCKER_PWD }}" | docker login -u "${{ secrets.DOCKER_LOGIN }}" --password-stdin | |
- name: Push multi-architecture Docker images | |
run: ./push-multi-arch-latest.sh |