hullcss-discord-bot/.github/workflows/publish.yml

51 lines
1.5 KiB
YAML
Raw Normal View History

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:24:20 +01:00
release:
types: [published]
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
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
2022-05-24 00:42:09 +01:00
with:
2022-06-27 12:24:20 +01:00
username: ${{ secrets.DOCKER_USERNAME }}
2022-05-24 00:42:09 +01:00
password: ${{ secrets.TOKEN }}
2022-06-27 12:24:20 +01:00
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
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 }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: |
my-docker-hub-namespace/my-docker-hub-repository
ghcr.io/${{ github.repository }}
- name: Build and push Docker images
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
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 }}