Skip to content

Commit

Permalink
Create docker-build-and-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jschmidt92 authored Sep 30, 2023
1 parent c08ae77 commit 7e7327c
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/docker-build-and-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: docker-build-and-publish

on:
push:
branches: none
pull_request:
branches: none
workflow_dispatch:

jobs:
build-and-publish-containers:
runs-on: ubuntu-latest
strategy:
matrix:
service:
- auth
- blog
- character
- discovery
- gateway
- rss

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Generate a timestamp and store it in an environment variable
- name: Set Timestamp
id: timestamp
run: echo "::set-output name=timestamp::$(date +%s)"

- name: Build Docker Image
working-directory: ${{ matrix.service }}
run: |
docker build . --file Dockerfile --tag ghcr.io/${{ github.repository_owner }}/org-sog-hq-${{ matrix.service }}:${{ steps.timestamp.outputs.timestamp }}
- name: Log into Docker registry
run: echo "${{ secrets.WORKFLOW_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin

- name: Push Docker Image to GitHub Packages
run: |
docker push ghcr.io/${{ github.repository_owner }}/org-sog-hq-${{ matrix.service }}:${{ steps.timestamp.outputs.timestamp }}

0 comments on commit 7e7327c

Please sign in to comment.