Docker Build #1058
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 Build" | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "33 3 * * *" | |
jobs: | |
docker_build: | |
name: "Docker Build" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Log in to ghcr | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build & Push | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./ | |
push: true | |
tags: ghcr.io/${{ github.repository }}:latest | |
print_current_version: | |
name: "Print Current Version" | |
runs-on: ubuntu-latest | |
needs: | |
- docker_build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Echo Version | |
run: |- | |
docker pull ghcr.io/${{ github.repository }}:latest | |
echo $(docker run --rm ghcr.io/${{ github.repository }}:latest version) > current_version.txt | |
- name: Commit & Push | |
uses: actions-js/push@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
message: update current version | |
branch: master |