Skip to content

init

init #2

Workflow file for this run

name: Docker
on:
workflow_dispatch:
push:
branches:
- main
permissions:
actions: write
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
name: 🐳 Build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
access_token: ${{ github.token }}
- name: 🐳 Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: 🔑 Github Registry Auth
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 👀 Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: 🐳 Build
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
COMMIT_SHA=${{ github.sha }}
BRANCH=${{ github.head_ref || github.ref_name }}