Merge pull request #648 from hyperweb-io/anmol/faucet-fix #374
This file contains hidden or 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: Starship Docker | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - release/* | |
| paths: | |
| - "starship/registry/**" | |
| - "starship/exposer/**" | |
| - "starship/faucet/**" | |
| - ".github/workflows/starship-docker.yaml" | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "starship/registry/**" | |
| - "starship/exposer/**" | |
| - "starship/faucet/**" | |
| - ".github/workflows/starship-docker.yaml" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-starship-docker | |
| cancel-in-progress: true | |
| jobs: | |
| deploy-docker: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| strategy: | |
| matrix: | |
| type: [ "registry", "exposer", "faucet" ] | |
| fail-fast: false | |
| defaults: | |
| run: | |
| working-directory: starship | |
| env: | |
| DOCKER_REPO: ghcr.io/hyperweb-io/starship | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - uses: dorny/paths-filter@v2 | |
| id: changes | |
| with: | |
| filters: | | |
| src: | |
| - 'starship/${{ matrix.type }}/**' | |
| - name: Set up QEMU | |
| if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' | |
| uses: docker/setup-qemu-action@v2 | |
| - name: Set up Docker Buildx | |
| if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Login to Docker Hub | |
| if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' | |
| uses: docker/login-action@v1 | |
| with: | |
| registry: ghcr.io | |
| username: hyperweb-io | |
| password: ${{ secrets.GH_HYPERWEB_PAT }} | |
| - name: Determine tag | |
| if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' | |
| id: docker-tag | |
| run: | | |
| tag=$(date -u "+%Y%m%d")-$(echo ${GITHUB_SHA} | cut -c1-7) | |
| echo Tag will be $tag | |
| echo ::set-output name=version::$tag | |
| - name: Build and push | |
| if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch' | |
| uses: docker/build-push-action@v4 | |
| with: | |
| push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} | |
| context: starship/${{ matrix.type }}/ | |
| tags: ghcr.io/hyperweb-io/starship/${{ matrix.type }}:${{ steps.docker-tag.outputs.version }} | |
| platforms: linux/amd64,linux/arm64 |