Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Docker workflow

Docker workflow #4

Workflow file for this run

# "secondly-xxxx" tagged images, used by developers for quick tests, are extremely unstable.
# Whenever any branch is updated, images are automatically built and pushed to image registry.
name: Publish Docker image
on: [push, pull_request]
env:
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
amd64:
name: AMD64
runs-on: ubuntu-latest
steps:
- name: Get current second
id: second
run: echo "::set-output name=second::$(date +'%Y-%m-%dT%H-%M-%S')"
- name: Show TAG_NAME
run: echo $TAG_NAME
env:
TAG_NAME: dev-${{ steps.second.outputs.second }}
-
name: Check out the repo
uses: actions/checkout@v3
-
name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ env.IMAGE_NAME }}:${{ env.TAG_NAME }}
cache-from: type=gha
cache-to: type=gha,mode=max