Skip to content

Commit e4aed9f

Browse files
authored
Merge pull request #7 from cupofpython/troubleshootlogin
Troubleshootlogin
2 parents 22077e9 + da4ed9d commit e4aed9f

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

.github/workflows/build-and-push.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@ name: Build and deploy image
22

33
on:
44
workflow_call:
5+
secrets:
6+
DOCKERHUB_TOKEN:
7+
required: true
58
inputs:
69
IMAGE_TAG:
710
required: true
811
type: string
912

1013
env:
1114
IMAGE_NAME: samanthamorris684/catbot
15+
USERNAME: ${{ vars.DOCKERHUB_USERNAME }}
16+
PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
1217

1318
jobs:
1419
build-and-push-image:
@@ -20,14 +25,14 @@ jobs:
2025
- name: Log in to Docker Hub
2126
uses: docker/[email protected]
2227
with:
23-
username: ${{ vars.DOCKERHUB_USERNAME }}
24-
password: ${{ secrets.DOCKERHUB_TOKEN }}
28+
username: ${{ env.USERNAME }}
29+
password: ${{ env.PASSWORD }}
2530

2631
- uses: actions/checkout@v4
2732
- name: Build and push the Docker image
2833
run: |
29-
- docker build -t $IMAGE_NAME:$TAG .
30-
- docker push $IMAGE_NAME:$TAG
34+
docker build -t $IMAGE_NAME:${{ inputs.IMAGE_TAG }} .
35+
docker push $IMAGE_NAME:${{ inputs.IMAGE_TAG }}
3136
3237
3338

.github/workflows/feature-branch.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ jobs:
88
build-and-push-feature:
99
uses: ./.github/workflows/build-and-push.yml
1010
with:
11-
IMAGE_TAG: $GITHUB_REF_NAME
11+
IMAGE_TAG: $GITHUB_REF_NAME
12+
secrets:
13+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
1214

1315

.github/workflows/main-branch.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ jobs:
88
build-and-push-main:
99
uses: ./.github/workflows/build-and-push.yml
1010
with:
11-
IMAGE_TAG: main@$GITHUB_SHA
11+
IMAGE_TAG: main@$GITHUB_SHA
12+
secrets:
13+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
1214

.github/workflows/release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Create release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
update-cluster:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Update cluster
12+
run: helm upgrade --set image.tag=<newtag>
13+

0 commit comments

Comments
 (0)