-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Tushar Mathur <tusharmath@gmail.com>
- Loading branch information
1 parent
b0752d3
commit 632cacb
Showing
1 changed file
with
50 additions
and
0 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 |
---|---|---|
@@ -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 }}' |