Skip to content

Commit

Permalink
Merge pull request #82 from whywaita/feat/build-docker-sha
Browse files Browse the repository at this point in the history
Add build-docker-sha.yaml
  • Loading branch information
whywaita authored Aug 2, 2021
2 parents 5ccdf2c + 02fcb92 commit da1f4df
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build-docker-sha.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build Docker image (sha)
on:
push:
branches:
- "**"

jobs:
docker-build-sha:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v3
id: meta
with:
images: ghcr.io/whywaita/myshoes
tags: |
type=sha
- name: Build container image
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.meta.outputs.tags }}

0 comments on commit da1f4df

Please sign in to comment.