forked from croservices/cro-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Build and Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Run test script | ||
run: ./scripts/test.sh | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
env: | ||
QUAY_USERNAME: chroot.club+cro_robot_rw | ||
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Build and push container | ||
run: ./scripts/cibuild.sh container | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
cmd_container () { | ||
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables | ||
tag_version="v1.$(date +%Y%m%d).${GITHUB_RUN_ID}.${GITHUB_RUN_NUMBER}" | ||
|
||
echo $QUAY_PASSWORD | docker login quay.io -u $QUAY_USERNAME --password-stdin | ||
full_tag="quay.io/chroot.club/cro-website:${tag_version}" | ||
docker build \ | ||
--build-arg quay_expiration="8w" \ | ||
-t $full_tag | ||
|
||
} | ||
|
||
|
||
if [ -z $1 ]; then | ||
cmd_container | ||
fi | ||
|
||
CMD=$1 | ||
shift | ||
case $CMD in | ||
container) | ||
cmd_$CMD $@ | ||
;; | ||
*) | ||
echo "unknown command $CMD" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
zef test . | ||
|