Update cicd.yml #4
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: CI/CD | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') # || github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Docker Login | |
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_TOKEN }} || echo could not login | |
- name: pull latest (for cache) | |
run: docker pull setecrs/zabbix-agent-gpu || echo could not pull | |
- name: Docker build latest | |
run: docker build --cache-from setecrs/zabbix-agent-gpu:latest . -t setecrs/zabbix-agent-gpu:latest | |
- name: Docker push latest (if master) | |
if: github.ref == 'refs/heads/master' | |
run: docker push setecrs/zabbix-agent-gpu:latest | |
- name: Docker push - semver | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
docker tag setecrs/samba-ad-member:latest setecrs/zabbix-agent-gpu:${GITHUB_REF#refs/tags/} | |
docker push setecrs/samba-ad-member:${GITHUB_REF#refs/tags/} | |