[CI] Run "Build & Test" for x86 and aarch64 platform on every push #10
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: Build & Publish Nightly Docker Image | |
on: | |
push: | |
branches: | |
- 'master' | |
env: | |
DOCKER_IMAGE: ghcr.io/${{ github.repository_owner }}/lurk-nightly | |
jobs: | |
publish-nightly-docker-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set Environment Variables | |
run: | | |
echo "SHORT_COMMIT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV | |
- name: Build and Push Docker Image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
file: ./docker/Dockerfile | |
platforms: linux/amd64,linux/arm64/v8 | |
tags: | | |
${{ env.DOCKER_IMAGE }}:${{ env.SHORT_COMMIT_SHA }},${{ env.DOCKER_IMAGE }}:latest |