Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: deploy-do-web issue with secrets #635

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions .github/workflows/deploy-do-web.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Deploy DO Web

on: workflow_dispatch
on:
pull_request:
branches:
- main

env:
FILENAME: Dockerfile.web
Expand All @@ -14,11 +17,22 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Build the Docker image
run: docker build -f "$FILENAME" -t "$IMAGE_NAME:$IMAGE_TAG" . # build the Docker image using envs defined above
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# login to dockerhub then push the image to the dockerhub repo
- name: Push Docker image
run: |-
echo ${{secrets.DOCKERHUB_PASS}} | docker login -u ${{secrets.DOCKERHUB_USER}} --password-stdin
docker push "$IMAGE_NAME:$IMAGE_TAG"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: "$IMAGE_NAME:$IMAGE_TAG"
file: "./src/$FILENAME"
context: .
Loading