Skip to content

Initial firestarter commit #104

Initial firestarter commit

Initial firestarter commit #104

Workflow file for this run

name: Push image
on:
push:
branches:
- main
jobs:
push:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
env:
IMAGE_NAME: ${{ github.repository }}
token: ${{ secrets.DOCKERHUB_TOKEN }}
steps:
- uses: actions/checkout@v3.5.2
- name: Log in to Github container registry
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@v2.1.0
if: ${{ env.token != '' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Github Packages
id: meta_github
uses: docker/metadata-action@v4.3.0
with:
images: ghcr.io/${{ github.actor }}/${{ env.IMAGE_NAME }}
flavor: latest=true
tags: |
type=semver,pattern={{ version }}
type=ref,event=tag
type=sha
type=raw,value=latest,enable={{ is_default_branch }}
- name: Extract metadata (tags, labels) for Docker Hub
if: ${{ env.token != '' }}
id: meta_docker
uses: docker/metadata-action@v4.3.0
with:
images: clauten/${{ env.IMAGE_NAME }}
flavor: latest=true
tags: |
type=semver,pattern={{ version }}
type=ref,event=tag
type=sha
type=raw,value=latest,enable={{ is_default_branch }}
- name: Build and push image to Github Packages
uses: docker/build-push-action@v4.0.0
with:
context: .
push: true
platforms: linux/amd64
tags: ${{ steps.meta_github.outputs.tags }}
labels: ${{ steps.meta_github.outputs.labels }}
- name: Build and push image to Docker Hub
uses: docker/build-push-action@v4.0.0
if: ${{ env.token != '' }}
with:
context: .
push: true
platforms: linux/amd64
tags: ${{ steps.meta_docker.outputs.tags }}
labels: ${{ steps.meta_docker.outputs.labels }}