github.com/tickoalcantara12/micro/v3@v3.0.0-20221007104245-9d75b9bcbab9/.github/workflows/docker.yml (about) 1 name: Docker 2 3 on: 4 push: 5 branches: 6 - master 7 tags: 8 - v2.* 9 - v3.* 10 jobs: 11 build: 12 runs-on: ubuntu-latest 13 steps: 14 15 - name: Clone repo 16 uses: actions/checkout@v2 17 18 - name: Fetch tags 19 run: git fetch --prune --unshallow 20 21 - name: Unique tag 22 id: unique_tag 23 run: echo "::set-output name=tag::$(date +%Y%m%d%H%M%S)$(git rev-parse --short HEAD)" 24 shell: bash 25 26 - name: Docker meta 27 id: meta 28 uses: docker/metadata-action@v3 29 with: 30 images: ghcr.io/micro/micro 31 flavor: latest=true 32 tags: ${{ steps.unique_tag.outputs.tag }} 33 34 - name: Set up QEMU 35 uses: docker/setup-qemu-action@v1 36 37 - name: Set up Docker Buildx 38 uses: docker/setup-buildx-action@v1 39 40 - name: Login to DockerHub 41 uses: docker/login-action@v2 42 with: 43 registry: ghcr.io 44 username: ${{ secrets.GHCR_ACTOR }} 45 password: ${{ secrets.GHCR_PAT }} 46 47 - name: Build and push 48 id: docker_build 49 uses: docker/build-push-action@v2 50 with: 51 context: . 52 push: true 53 platforms: linux/amd64,linux/arm64 54 tags: ${{ steps.meta.outputs.tags }} 55 labels: ${{ steps.meta.outputs.labels }}