Skip to content

Commit

Permalink
try docker hub
Browse files Browse the repository at this point in the history
  • Loading branch information
ji-podhead committed Aug 5, 2024
1 parent 3ab88ab commit c180a6d
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions .github/workflows/galaxy_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,27 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Fetch Vault Secret
id: fetch-vault-secret
uses: hashicorp/vault-action@v2
with:
url: http://localhost:8200
token: ${{ secrets.VAULT_TOKEN }}
secrets: |
/keyvalue/data/docker/hub pass | DOCKER_HUB_ACCESS_TOKEN ;
echo $DOCKER_HUB_ACCESS_TOKEN
/v1/keyvalue/data/docker/hub user | DOCKER_HUB_USERNAME ;
echo $DOCKER_HUB_USERNAME
- name: Set environment variables
run: |
echo "DOCKER_HUB_USERNAME=${{ steps.fetch-vault-secret.outputs.secrets.DOCKER_HUB_USERNAME }}" >> $GITHUB_ENV
echo "DOCKER_HUB_ACCESS_TOKEN=${{ steps.fetch-vault-secret.outputs.secrets.DOCKER_HUB_ACCESS_TOKEN }}" >> $GITHUB_ENV
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ env.DOCKER_HUB_USERNAME }}
password: ${{ env.DOCKER_HUB_ACCESS_TOKEN }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: my-docker-hub-namespace/my-docker-hub-repository

- name: Build and push Docker image
id: push
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit c180a6d

Please sign in to comment.