This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
[github-actions] Bump docker/login-action from 3.0.0 to 3.1.0 #52
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: Publish | |
on: | |
push: | |
jobs: | |
publish_to_dockerhub: | |
name: Publish to DockerHub | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Setup: Check out the repo" | |
uses: actions/checkout@v4 | |
- name: "Setup: Get the branch name for tagging purposes" | |
run: |- | |
GIT_BRANCH_NAME=$(echo '${{ github.ref_name }}' | sed -e 's|/|-|g') | |
echo "GIT_BRANCH_NAME=$GIT_BRANCH_NAME" >> $GITHUB_ENV | |
- name: "Setup: Setup QEMU" | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: "arm64,arm" | |
- name: "Setup: Setup Docker Buildx" | |
uses: docker/setup-buildx-action@v3 | |
- name: "Setup: Log in to Docker Hub" | |
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 | |
with: | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: "Build: Build and Push Image" | |
uses: docker/build-push-action@v5 | |
with: | |
tags: ${{ vars.DOCKERHUB_USERNAME }}/dotnet-nvm:${{ env.GIT_BRANCH_NAME }} | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
- name: "Build: Pull image" | |
run: docker pull ${{ vars.DOCKERHUB_USERNAME }}/dotnet-nvm:${{ env.GIT_BRANCH_NAME }} | |
- name: "Build: Check tools are installed" | |
run: |- | |
echo "dotnet version: $(docker run --rm ${{ vars.DOCKERHUB_USERNAME }}/dotnet-nvm:${{ env.GIT_BRANCH_NAME }} /bin/bash --login -c 'dotnet --version')" | |
echo "nvm version: $(docker run --rm ${{ vars.DOCKERHUB_USERNAME }}/dotnet-nvm:${{ env.GIT_BRANCH_NAME }} /bin/bash --login -c 'nvm --version')" | |
echo "node version: $(docker run --rm ${{ vars.DOCKERHUB_USERNAME }}/dotnet-nvm:${{ env.GIT_BRANCH_NAME }} /bin/bash --login -c 'node --version')" | |
echo "docker version: $(docker run --rm ${{ vars.DOCKERHUB_USERNAME }}/dotnet-nvm:${{ env.GIT_BRANCH_NAME }} /bin/bash --login -c 'docker --version')" | |
echo "docker compose version: $(docker run --rm ${{ vars.DOCKERHUB_USERNAME }}/dotnet-nvm:${{ env.GIT_BRANCH_NAME }} /bin/bash --login -c 'docker compose version')" | |
- name: "Latest: Build and Push Image" | |
if: github.ref == 'refs/heads/main' | |
uses: docker/build-push-action@v5 | |
with: | |
tags: ${{ vars.DOCKERHUB_USERNAME }}/dotnet-nvm:latest | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
- name: "Latest: Update Dockerhub description" | |
if: github.ref == 'refs/heads/main' | |
uses: peter-evans/dockerhub-description@v4 | |
with: | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
repository: ${{ vars.DOCKERHUB_USERNAME }}/dotnet-nvm |