diff --git a/.github/workflows/publish-gh-container.yml b/.github/workflows/publish-gh-container.yml new file mode 100755 index 0000000000..219bb4edab --- /dev/null +++ b/.github/workflows/publish-gh-container.yml @@ -0,0 +1,41 @@ +name: dev-deploy +on: + push: + branches: + [dev] +jobs: + dev-deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: 16.x + - name: Build Docker Image + run: bash scripts/build_docker.sh dev $DOCKER_LABEL + env: + DOCKER_LABEL: ${{ secrets.DOCKER_LABEL }} + REPO_NAME: ${{ secrets.REPO_NAME }} + ECR_URL: ${{ secrets.ECR_URL }} + - name: Publish to GitHub Container Packages + run: bash scripts/publish_gh_container.sh ${{ github.event.release.tag_name }} $DOCKER_LABEL + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_USERNAME: ${{ github.actor }} + DOCKER_LABEL: ${{ secrets.DOCKER_LABEL }} + - name: Job succeeded + if: always() + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 # Not needed with a .ruby-version file + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + env: + JOB_STATUS: ${{ job.status }} + WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }} + HOOK_OS_NAME: ${{ runner.os }} + WORKFLOW_NAME: ${{ github.workflow }} + run: | + git clone https://github.com/DiscordHooks/github-actions-discord-webhook.git webhook + bash webhook/send.sh $JOB_STATUS $WEBHOOK_URL + shell: bash \ No newline at end of file diff --git a/scripts/publish_gh_container.sh b/scripts/publish_gh_container.sh new file mode 100755 index 0000000000..06a59d0fed --- /dev/null +++ b/scripts/publish_gh_container.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e +set -x + +TAG=$1 +LABEL=$2 + +echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$GITHUB_USERNAME" --password-stdin + +docker tag ${LABEL} ${LABEL}:${TAG} +docker push ${LABEL}:${TAG} \ No newline at end of file