Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Adding workflow to publish release Dockerfile to GH registry.
Browse files Browse the repository at this point in the history
  • Loading branch information
barankyle committed Jun 29, 2021
1 parent 47d068d commit 954fc40
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/publish-gh-container.yml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions scripts/publish_gh_container.sh
Original file line number Diff line number Diff line change
@@ -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}

0 comments on commit 954fc40

Please sign in to comment.