statgarten_update #32
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: Build and Push Docker Image Manually(Core) | |
on: | |
push: | |
tags: | |
- "v*" | |
paths: | |
- "statgarten/door/**" | |
- "statgarten/datatoys/**" | |
- "statgarten/shiny.likert/**" | |
- "statgarten/stove/**" | |
- "statgarten/colorpen/**" | |
- "statgarten/soroban/**" | |
- "statgarten/scissor/**" | |
repository_dispatch: | |
types: [statgarten_update] | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
with: | |
images: | | |
statgarten/dockerImage | |
- name: Set TAG env | |
if: github.event_name == 'push' | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Set TAG env | |
if: github.event_name == 'repository_dispatch' | |
run: echo "RELEASE_VERSION=v$(date +'%Y%m%d')" >> $GITHUB_ENV | |
- name: Metadata | |
run: echo "container tag will be 'lastest' and '${{ env.RELEASE_VERSION }}'" | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub/ | |
uses: docker/#-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/#-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GHCR_TOKEN }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v4 | |
with: | |
file: core.dockerfile | |
push: true | |
tags: | | |
dao0312/statgarten:latest_core | |
dao0312/statgarten:${{ env.RELEASE_VERSION }}_core | |
ghcr.io/${{ github.repository_owner }}/statgarten:latest_core | |
ghcr.io/${{ github.repository_owner }}/statgarten:${{ env.RELEASE_VERSION }}_core |