fix(deps): update all non-major dependencies #27
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 & Push Docker Image to container image registry | |
on: | |
release: | |
types: [created] | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "Dockerfile" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check Out Repo | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
#- name: Set up QEMU (We don't need QEMU, because we don't build images for platforms other than linux/amd64, which is our current native arch in our infra | |
# uses: docker/[email protected] | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2.10.0 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 | |
if: ${{ github.event_name != 'pull_request' }} | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract tag name | |
id: tags | |
if: ${{ github.event_name == 'release' }} | |
run: echo ::set-output name=name::${GITHUB_REF##*/} | |
- name: Extract flavor | |
id: flavor | |
run: if [ "${{ github.event_name }}" = "release" ]; then echo ::set-output name=name::; else echo ::set-output name=name::-dev; fi | |
- name: Generate Docker image metadata | |
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4.6.0 | |
id: img_meta | |
with: | |
flavor: | | |
latest=auto | |
suffix=${{ steps.flavor.outputs.name }} | |
images: ghcr.io/frutbits/nextjs-tailwind-boilerplate | |
tags: | | |
${{ steps.tags.outputs.name }} | |
latest | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9 # v4.2.1 | |
with: | |
context: ./ | |
tags: ${{ steps.img_meta.outputs.tags }} | |
labels: ${{ steps.img_meta.outputs.labels }} | |
push: ${{ github.event_name != 'pull_request' }} | |
cache-from: type=gha,mode=max | |
cache-to: type=gha,mode=max |