Update packages and the base image #19
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: ci | |
on: | |
push: | |
tags: | |
- 'v*' | |
pull_request: | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v2 | |
- | |
name: Docker meta | |
id: docker_meta | |
uses: crazy-max/ghaction-docker-meta@v1 | |
with: | |
images: antmoc/antmoc-ci | |
tag-semver: | | |
{{version}} | |
{{major}}.{{minor}} | |
- | |
name: Prepare arguments | |
id: prep | |
run: | | |
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') | |
echo ::set-output name=vcs_url::$(git config --get remote.origin.url) | |
echo ::set-output name=vcs_ref::$(git rev-parse --short HEAD) | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- | |
name: Login to DockerHub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- | |
name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64 | |
build-args: | | |
BUILD_DATE=${{ steps.prep.outputs.created }} | |
VCS_URL=${{ steps.prep.outputs.vcs_url }} | |
VCS_REF=${{ steps.prep.outputs.vcs_ref }} | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
- | |
name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |