Skip to content

Commit

Permalink
feat: pushing version when workflow is called using schedule (#687)
Browse files Browse the repository at this point in the history
  • Loading branch information
epsjunior authored Dec 5, 2024
1 parent 1209fde commit 0570773
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions .github/workflows/docker-build-and-push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,43 +31,36 @@ jobs:
steps:
- uses: actions/checkout@v4

# TODO: Once we have the 1Password service account token, we can use the following action to load secrets
# "better done than perfect"

# - name: Load secrets from 1Password
# uses: 1password/load-secrets-action/configure@v1
# id: op-load-secret
# with:
# service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
# env:
# DOCKERHUB_USERNAME:
# DOCKERHUB_TOKEN:

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ inputs.dockerhub_username }}
password: ${{ secrets.dockerhub_token }}
# username: ${{ steps.op-load-secret.outputs.DOCKERHUB_USERNAME }}
# password: ${{ steps.op-load-secret.outputs.DOCKERHUB_TOKEN }}

- name: Create .env file
run: cp .env.example .env

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# jsonrpc
- name: Fetch All Tags
run: git fetch --tags

- name: Get the Most Recent Git Tag
id: get_latest_tag
run: |
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "latest_tag=$latest_tag" >> $GITHUB_ENV
- name: Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ inputs.dockerhub_repo }}
tags: |
type=ref,event=tag
type=raw,value=latest
type=semver,pattern={{version}}
${{ env.latest_tag }}
latest
- name: Build and push
uses: docker/build-push-action@v6
Expand Down

0 comments on commit 0570773

Please sign in to comment.