Skip to content

Commit

Permalink
Add a GHA setup for deploying docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka committed Nov 9, 2023
1 parent aa637fc commit a26dc5c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: main

on:
workflow_dispatch:
pull_request:
push:

jobs:
deploy-docker:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
if: (github.repository == 'digital-blueprint/website' && github.event_name == 'push' && github.ref == 'refs/heads/main')
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Log in
run: |
echo "$TOKEN" | docker login ghcr.io --username "$USERNAME" --password-stdin
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
USERNAME: ${{ github.actor }}
- name: Build image
run: |
docker build --tag ghcr.io/digital-blueprint/website:latest .
- name: Deploy image
run: |
docker push ghcr.io/digital-blueprint/website:latest

0 comments on commit a26dc5c

Please sign in to comment.