-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Dillon Barnes <[email protected]>
- Loading branch information
Showing
1 changed file
with
30 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,37 @@ | ||
name: Docker Runner | ||
name: 'Deploy to GHCR' | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run: | ||
runs-on: self-hosted | ||
environment: production | ||
push-store-image: | ||
runs-on: ARM64 | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Login to GHCR | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run Container | ||
run: docker compose up -d --build | ||
env: | ||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }} | ||
DB_URI: ${{secrets.DB_URI}} | ||
WEATHER_TOKEN: ${{secrets.WEATHER_TOKEN}} | ||
|
||
- name: Cleanup Unused Images | ||
run: docker image prune -f | ||
- name: Convert repository name to lowercase | ||
id: repo | ||
run: echo "::set-output name=repo::$(echo ${{ github.repository }} | awk '{print tolower($0)}')" | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: ghcr.io/${{ steps.repo.outputs.repo }}:latest |