aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2020-11-15 16:49:53 +0000
committerGravatar Joe Banks <[email protected]>2020-11-15 16:49:53 +0000
commitf496911904eba3aa1236092b645ae53f9feb4fa3 (patch)
treea9e29750317169c95d904e917c59f1349883673d
parentAdd index on message table for author and channel ID (diff)
Publish to GHCR and remove salt autodeploy
-rw-r--r--.github/workflows/deploy.yml48
1 files changed, 29 insertions, 19 deletions
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index db471e4..1a08f58 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -11,27 +11,37 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v
- - name: Build Docker image
- run: docker build . --file Dockerfile -t python-discord/metricity/metricity:latest
+ - name: Create SHA Container Tag
+ id: sha_tag
+ run: |
+ tag=$(cut -c 1-7 <<< $GITHUB_SHA)
+ echo "::set-output name=tag::$tag"
- - name: Publish Docker image
- uses: elgohr/Publish-Docker-Github-Action@master
- with:
- name: python-discord/metricity/metricity:latest
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
- registry: docker.pkg.github.com
-
- trigger_autodeploy:
- name: Trigger Auto-Deploy
- runs-on: ubuntu-latest
+ - name: Checkout code
+ uses: actions/checkout@v2
- needs: [push_docker_image]
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v1
- steps:
- - name: curl
- uses: wei/curl@v1
+ - 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 builds and pushed the container to the
+ # Github Container Registry tagged with "latest" and
+ # the short SHA of the commit.
+ - name: Build and push
+ uses: docker/build-push-action@v2
with:
- args: -X POST ${{ secrets.AUTODEPLOY_URL }}
+ context: .
+ file: ./Dockerfile
+ push: true
+ cache-from: type=registry,ref=ghcr.io/python-discord/metricity:latest
+ tags: |
+ ghcr.io/python-discord/metricity:latest
+ ghcr.io/python-discord/metricity:${{ steps.sha_tag.outputs.tag }}