Skip to content

Commit

Permalink
fix actions ref resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
cornfeedhobo committed Mar 16, 2024
1 parent e8da1f4 commit 75edffe
Showing 1 changed file with 30 additions and 16 deletions.
46 changes: 30 additions & 16 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,6 @@ jobs:
echo "date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT"
echo "version=$(< VERSION)" >> "$GITHUB_OUTPUT"
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

- name: Get monero tag ref
id: get_release_ref
uses: octokit/request-action@v2.x
Expand All @@ -43,6 +28,20 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get monero commit ref url
id: get_commit_ref_url
run: |
URL="${{ fromJson(steps.get_release_ref.outputs.data).object.url }}"
echo "ref_url=${URL/https:\/\/api.github.com}" >> "$GITHUB_OUTPUT"
- name: Get monero commit ref
id: get_commit_ref
uses: octokit/request-action@v2.x
with:
route: GET ${{ steps.get_commit_ref_url.outputs.ref_url }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Docker metadata mapping
id: meta
uses: docker/metadata-action@v5
Expand All @@ -54,6 +53,21 @@ jobs:
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/master' }}
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

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

Expand All @@ -66,4 +80,4 @@ jobs:
build-args: |
BUILD_DATE=${{ steps.context.outputs.date }}
MONERO_TAG=${{ steps.context.outputs.version }}
MONERO_SHA=${{ fromJson(steps.get_release_ref.outputs.data).object.sha }}
MONERO_SHA=${{ fromJson(steps.get_commit_ref.outputs.data).object.sha }}

0 comments on commit 75edffe

Please sign in to comment.