Update container.yml #21
Workflow file for this run
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
name: "Make Docker Image" | |
on: | |
push: | |
tags: | |
- "**" | |
jobs: | |
build: | |
name: "Build Image" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
node: [ 16 ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get Tag Name | |
id: get_version | |
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GHCR_TOKEN }} | |
- name: Create Dotenv File | |
uses: actually-colab/github-action-create-env-file@v2.3 | |
with: | |
envkey_CEVER_VERSION: ${{ steps.get_version.outputs.VERSION }} | |
directory: . | |
file_name: .env | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64 | |
push: true | |
tags: | | |
hoshinosuzumi/ctfever:${{ steps.get_version.outputs.VERSION }} | |
hoshinosuzumi/ctfever:latest | |
ghcr.io/uniiemstudio/ctfever:${{ steps.get_version.outputs.VERSION }} | |
ghcr.io/uniiemstudio/ctfever:latest | |
deploy: | |
name: "Trigger automatic pull" | |
runs-on: ${{ matrix.os }} | |
needs: | |
- build | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
node: [ 16 ] | |
steps: | |
- name: Webhook POST Action | |
# You may pin to the exact commit or the version. | |
# uses: muinmomin/webhook-action@7c067ef19e5de3aca7aebda32628f1d08d06bf89 | |
uses: muinmomin/webhook-action@v1.0.0 | |
with: | |
# URL of webhook to send post request to | |
url: ${{ secrets.DEPLOY_WEBHOOK }} |