Skip to content

Commit

Permalink
Publish TC Server on GHCR (#259)
Browse files Browse the repository at this point in the history
Co-authored-by: Tushar Mathur <tusharmath@gmail.com>
  • Loading branch information
amitksingh1490 and tusharmath authored Jul 27, 2023
1 parent b0752d3 commit 632cacb
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Docker Publish
on:
release:
types:
- published
permissions:
contents: write
pull-requests: write
jobs:
dockerStage:
name: Docker Stage
strategy:
matrix:
os: [ ubuntu-latest ]
scala: [ 2.13.11 ]
java: [ temurin@20 ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (fast)
uses: actions/checkout@v3

- run: sbt Docker/stage

- uses: actions/upload-artifact@v2
with:
name: docker_context
path: ./target/docker/stage
release:
name: Docker Publish
needs: [ dockerStage ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: actions/download-artifact@v2
with:
name: docker_context

- name: Build Docker image
run: 'docker build --tag tc-server:${{ github.sha }} .'

- name: Login to GitHub Container Registry
run: echo ${{ secrets.GITHUBTOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Tag Docker image
run: 'docker tag tc-server:${{ github.sha }} ghcr.io/${{ github.repository }}/tc-server:${{ github.event.release.tag_name }}'

- name: Push Docker image to GitHub Container Registry
run: 'docker push ghcr.io/${{ github.repository }}/tc-server:${{ github.event.release.tag_name }}'

0 comments on commit 632cacb

Please sign in to comment.