Add publish action. #9
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
name: Docker Image CI | |
on: | |
pull_request: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Java JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
- name: Install clojure tools | |
uses: DeLaGuardo/[email protected] | |
with: | |
lein: 2.9.1 | |
- name: Build Uberjar | |
run: lein uberjar | |
- name: Build the Docker image | |
run: docker build . --file Dockerfile --tag pronouns.alysbrooks.com:latest --tag pronouns.alysbrooks.com:${{ github.ref_name }} --tag pronouns.alysbrooks.com:$(date +%s) --tag ghcr.io/alysbrooks/pronouns.alysbrooks.com:${{ github.ref_name}} | |
- name: Log in to GitHub's Container registry | |
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish the Docker image | |
run: docker push ghcr.io/alysbrooks/pronouns.alysbrooks.com:${{ github.ref_name}} |