Skip to content

Commit 3c032f3

Browse files
committed
Clean up gh action
1 parent 5b89be4 commit 3c032f3

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

.github/workflows/build_docker.yml

+4-13
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
canarytokens-docker-branch:
1212
description: "Branch of the canarytokens-docker repo to pull for build. Defaults to master"
1313
required: false
14+
default: "master"
1415

1516
jobs:
1617
build:
@@ -19,21 +20,11 @@ jobs:
1920
COPYFILE_DISABLE: 1
2021

2122
steps:
22-
# Checkout canarytokens-docker repo. This lands in ./canarytokens-docker
23-
- name: Set canarytokens-docker-branch
24-
run: |
25-
if [ -z "${{ github.event.inputs.canarytokens-docker-branch}}" ]; then
26-
BRANCH="master"
27-
else echo
28-
BRANCH="${{ github.event.inputs.canarytokens-docker-branch }}"
29-
fi
30-
echo "CANARYTOKENS_DOCKER_BRANCH=$BRANCH" >> $GITHUB_ENV
31-
3223
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
3324
with:
3425
repository: thinkst/canarytokens-docker
3526
path: canarytokens-docker
36-
ref: ${{ env.CANARYTOKENS_DOCKER_BRANCH }}
27+
ref: ${{ github.event.inputs.canarytokens-docker-branch }}
3728

3829
- name: Set up Docker Buildx
3930
uses: docker/setup-buildx-action@v1
@@ -90,7 +81,7 @@ jobs:
9081
cd /home/ubuntu/canarytokens-scripts/
9182
./canarytokensdb_s3backup.sh
9283
cd /home/ubuntu/canarytokens-docker
93-
git stash && git checkout ${{ env.CANARYTOKENS_DOCKER_BRANCH }} && git pull
84+
git stash && git checkout ${{ github.event.inputs.canarytokens-docker-branch }} && git pull
9485
sed "s/thinkst\/canarytokens$/thinkst\/canarytokens:${GITHUB_REF##*/}/g" common-services.yml > common-services-${GITHUB_REF##*/}.yml
9586
sed "s/file: common-services.yml/file: common-services-${GITHUB_REF##*/}.yml/g" docker-compose-letsencrypt.yml > docker-compose-letsencrypt-${GITHUB_REF##*/}.yml
9687
sed -i'' "s/CANARY_DEV_BUILD_ID=.*/CANARY_DEV_BUILD_ID=${GITHUB_SHA:0:8}/" frontend.env
@@ -110,7 +101,7 @@ jobs:
110101
cd /home/ubuntu/canarytokens-scripts/
111102
./canarytokensdb_s3backup.sh
112103
cd /home/ubuntu/canarytokens-docker
113-
git stash && git checkout master && git pull
104+
git stash && git checkout ${{ github.event.inputs.canarytokens-docker-branch }} && git pull
114105
sed "s/thinkst\/canarytokens$/thinkst\/canarytokens:${GITHUB_REF##*/}/g" common-services.yml > common-services-${GITHUB_REF##*/}.yml
115106
sed "s/file: common-services.yml/file: common-services-${GITHUB_REF##*/}.yml/g" docker-compose-aws-logging-letsencrypt.yml > docker-compose-aws-logging-letsencrypt-${GITHUB_REF##*/}.yml
116107
sed -i'' "s/CANARY_DEV_BUILD_ID=.*/CANARY_DEV_BUILD_ID=${GITHUB_SHA:0:8}/" frontend.env

0 commit comments

Comments
 (0)