Merge pull request #122 from inbo/update-GHA #53
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: On push to main add a tag to the commit if docker or renv stuff changed | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Tag in case renv or docker files changed | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. | |
- name: Get changed files | |
id: changed-files-specific | |
uses: tj-actions/changed-files@v44 | |
with: | |
files: | | |
Dockerfile | |
docker | |
renv.lock | |
- name: Create docker git tag if any of the files changed | |
if: steps.changed-files-specific.outputs.any_changed == 'true' | |
run: | | |
git config --global user.email "info@inbo.be" | |
git config --global user.name "inbo" | |
git tag -a docker-${{ github.sha }} -m "new docker image" | |
git push --follow-tags |