update pycord #168
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
# vim: ts=2 sw=2: | |
name: Docker Build and Deploy | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- master | |
push: | |
# Publish `master` as Docker `dev` image. | |
branches: | |
- master | |
# Publish `v*` tags as x.x.x images and as `latest`. | |
tags: | |
- v* | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
docker: | |
name: Build and push docker images | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- name: Checkout | |
uses: classabbyamp/treeless-checkout-action@v1 | |
- name: Write ref to file | |
if: ${{ github.event_name != 'pull_request' }} | |
run: git rev-list -n 1 $GITHUB_REF > ./git_commit | |
- name: Docker metadata | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
ghcr.io/${{ github.repository }} | |
tags: | | |
type=sha,prefix= | |
type=raw,value=dev,enable={{is_default_branch}} | |
type=match,pattern=v(.*),group=1 | |
labels: | | |
org.opencontainers.image.authors=classabbyamp and 0x5c | |
org.opencontainers.image.url=https://github.com/miaowware/qrm2 | |
org.opencontainers.image.source=https://github.com/${{ github.repository }} | |
org.opencontainers.image.vendor=miaowware | |
org.opencontainers.image.title=qrm2 | |
org.opencontainers.image.description=Discord bot with ham radio functions | |
org.opencontainers.image.licenses=LiLiQ-Rplus-1.1 | |
- name: Login to Github Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |