Skip to content

Bump D.py to 2.3.1

Bump D.py to 2.3.1 #31

name: Build and push to GHCR
on:
push:
branches:
- deployment
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
# Create a shorter commit SHA-based tag for a GHCR tag
- name: Create SHA Container Tag
id: sha_tag
run: |
tag=$(cut -c 1-7 <<< $GITHUB_SHA)
echo "::set-output name=tag::$tag"
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Github Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push the container to the GitHub Container
# Repository. The container will be tagged as "latest"
# and with the short SHA of the commit.
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
cache-from: type=registry,ref=ghcr.io/python-discord/modmail:latest
cache-to: type=inline
tags: |
ghcr.io/python-discord/modmail:latest
ghcr.io/python-discord/modmail:${{ steps.sha_tag.outputs.tag }}