This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
chore(deps): update golang docker digest to 7b297d9 #462
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 Image CI | |
on: | |
push: | |
branches: | |
- 'master' | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- 'master' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@7c79b598eaa33458e78e8d0d71e0a9c217dd92af | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@f2a13332ac1ce8c0a71aeac48a150dbb1838ab67 | |
with: | |
images: | | |
else/tor-node | |
ghcr.io/${{ github.repository }} | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Build Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: false | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Validate Tor | |
run: docker run --rm ${{ fromJSON(steps.meta.outputs.json).tags[0] }} --verify-config | |
- name: Analyze Docker image | |
uses: yuichielectric/dive-action@0.0.4 | |
with: | |
image: ${{ fromJSON(steps.meta.outputs.json).tags[0] }} | |
- name: Login to the Container registry | |
uses: docker/login-action@7c79b598eaa33458e78e8d0d71e0a9c217dd92af | |
if: ${{ github.event_name != 'pull_request' }} | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@7c79b598eaa33458e78e8d0d71e0a9c217dd92af | |
if: ${{ github.event_name != 'pull_request' }} | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Push Docker image | |
uses: docker/build-push-action@v2 | |
if: ${{ github.event_name != 'pull_request' }} | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |