2022-06-27 12:24:20 +01:00
|
|
|
# This workflow uses actions that are not certified by GitHub.
|
|
|
|
# They are provided by a third-party and are governed by
|
|
|
|
# separate terms of service, privacy policy, and support
|
|
|
|
# documentation.
|
2022-05-24 00:42:09 +01:00
|
|
|
|
2022-06-27 12:24:20 +01:00
|
|
|
name: Publish Docker image
|
2022-05-24 00:42:09 +01:00
|
|
|
|
|
|
|
on:
|
2022-06-27 12:27:17 +01:00
|
|
|
push:
|
2022-12-22 09:52:59 +00:00
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
2022-05-24 00:42:09 +01:00
|
|
|
jobs:
|
2022-06-27 12:24:20 +01:00
|
|
|
push_to_registries:
|
|
|
|
name: Push Docker image to multiple registries
|
2022-05-24 00:42:09 +01:00
|
|
|
runs-on: ubuntu-latest
|
2022-06-27 12:24:20 +01:00
|
|
|
permissions:
|
|
|
|
packages: write
|
|
|
|
contents: read
|
2022-05-24 00:42:09 +01:00
|
|
|
steps:
|
2022-06-27 12:24:20 +01:00
|
|
|
- name: Check out the repo
|
2023-05-24 10:04:13 +01:00
|
|
|
uses: actions/checkout@v3.5.2
|
2022-12-05 22:44:54 +00:00
|
|
|
|
2022-06-27 12:24:20 +01:00
|
|
|
- name: Log in to Docker Hub
|
2022-10-17 08:34:33 +01:00
|
|
|
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
|
2022-05-24 00:42:09 +01:00
|
|
|
with:
|
2022-06-27 12:30:09 +01:00
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
2022-12-05 22:44:54 +00:00
|
|
|
|
2022-06-27 12:24:20 +01:00
|
|
|
- name: Log in to the Container registry
|
2022-10-17 08:34:33 +01:00
|
|
|
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
|
2022-05-24 00:42:09 +01:00
|
|
|
with:
|
2022-06-27 12:24:20 +01:00
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2022-12-05 22:44:54 +00:00
|
|
|
|
2022-06-27 12:24:20 +01:00
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
|
|
id: meta
|
2023-04-24 09:00:43 +01:00
|
|
|
uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e
|
2022-06-27 12:24:20 +01:00
|
|
|
with:
|
|
|
|
images: |
|
2022-06-27 12:31:35 +01:00
|
|
|
${{ secrets.DOCKERHUB_USERNAME }}/hullcss
|
2022-06-27 12:24:20 +01:00
|
|
|
ghcr.io/${{ github.repository }}
|
2022-12-05 22:44:54 +00:00
|
|
|
|
2022-06-27 12:24:20 +01:00
|
|
|
- name: Build and push Docker images
|
2023-02-06 07:06:09 +00:00
|
|
|
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
|
2022-06-27 12:24:20 +01:00
|
|
|
with:
|
|
|
|
context: .
|
2022-05-24 00:42:09 +01:00
|
|
|
push: true
|
2022-06-27 12:24:20 +01:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|