Build images and push (on master branch or on schedule) #72
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 images and push (on master branch or on schedule) | |
on: | |
push: | |
branches: | |
- master | |
schedule: | |
- cron: '0 0 1 * *' | |
workflow_dispatch: | |
jobs: | |
push: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Run CI | |
run: | | |
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USER }} --password-stdin | |
echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ secrets.CR_USER }} --password-stdin | |
docker build -t ppiper/cf-cli:latest . | |
docker tag ppiper/cf-cli:latest ghcr.io/sap/ppiper-cf-cli:latest | |
docker push ppiper/cf-cli:latest | |
docker push ghcr.io/sap/ppiper-cf-cli:latest |