Skip to content

Commit fb4a1ff

Browse files
authored
Create test.yml
1 parent 3846097 commit fb4a1ff

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
env:
10+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
11+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
12+
DOCKER_REPO: doocs/leetcode
13+
14+
15+
jobs:
16+
deploy:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
ref: gh-pages
22+
path: site
23+
- name: Build Docker Image
24+
run: |
25+
docker build -t ${{ env.DOCKER_REPO }}:latest .
26+
- name: Login to DockerHub
27+
run: |
28+
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
29+
- name: Push Docker Image to DockerHub
30+
run: |
31+
docker push ${{ env.DOCKER_REPO }}:latest

0 commit comments

Comments
 (0)