aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/lint-test-build.yml24
1 files changed, 22 insertions, 2 deletions
diff --git a/.github/workflows/lint-test-build.yml b/.github/workflows/lint-test-build.yml
index dc4ea5fd9..a5a930912 100644
--- a/.github/workflows/lint-test-build.yml
+++ b/.github/workflows/lint-test-build.yml
@@ -123,6 +123,12 @@ jobs:
runs-on: ubuntu-latest
steps:
+ # Create a commit SHA-based tag for the container repositories
+ - 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
@@ -135,11 +141,25 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
+ - name: Login to Github Container Registry
+ uses: docker/login-action@v1
+ with:
+ registry: ghcr.io
+ username: ${{ github.repository_owner }}
+ password: ${{ secrets.GHCR_TOKEN }}
+
+ # This step currently pushes to both DockerHub and GHCR to
+ # make the migration easier. The DockerHub push will be
+ # removed once we've migrated to our K8s cluster.
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
- cache-from: type=registry,ref=pythondiscord/bot:latest
- tags: pythondiscord/bot:latest
+ cache-from: type=registry,ref=ghcr.io/python-discord/bot:latest
+ tags: |
+ ghcr.io/python-discord/bot:latest
+ ghcr.io/python-discord/bot:${{ steps.sha_tag.outputs.tag }}
+ pythondiscord/bot:latest
+ pythondiscord/bot:${{ steps.sha_tag.outputs.tag }}