CityEnergyAnalyst v4.0.0-alpha #115
Workflow file for this run
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: | |
push: | |
branches: [master] | |
release: | |
types: [published] | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract Repository Name | |
run: echo "REPO_NAME=${GITHUB_REPOSITORY@L}" >>${GITHUB_ENV} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: | | |
${{ secrets.DOCKERHUB_USERNAME }}/cea:dev | |
ghcr.io/${{ env.REPO_NAME }}/cea:dev | |
- name: Push version tag on release | |
if: github.event_name == 'release' && github.event.action == 'published' | |
run: | | |
docker buildx imagetools create \ | |
--tag ${{ secrets.DOCKERHUB_USERNAME }}/cea:${GITHUB_REF##*/} \ | |
--tag ${{ secrets.DOCKERHUB_USERNAME }}/cea:latest \ | |
--tag ghcr.io/${{ env.REPO_NAME }}/cea:${GITHUB_REF##*/} \ | |
--tag ghcr.io/${{ env.REPO_NAME }}/cea:latest \ | |
ghcr.io/${{ env.REPO_NAME }}/cea:dev | |