-
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.
setup container builds for application
- Loading branch information
1 parent
97239b8
commit c551a3e
Showing
4 changed files
with
72 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,33 @@ | ||
name: Build packages and publish to Github Container Registry | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Node.js, NPM and Yarn | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build the containers | ||
run: ./build-container.sh ${{ github.ref_name }} | ||
shell: bash |
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,11 @@ | ||
FROM nginx:latest | ||
LABEL org.opencontainers.image.source=https://github.com/CoEDL/50words.online | ||
LABEL org.opencontainers.image.description="The 50 words application" | ||
LABEL org.opencontainers.image.licenses=GPLv3 | ||
|
||
# RUN apt-get update && apt-get install -y nginx-extras | ||
RUN rm /etc/nginx/conf.d/default.conf | ||
|
||
COPY ./dist/ /srv/50words/www/ | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
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,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
VERSION=$1 | ||
echo "Building $VERSION" | ||
|
||
# build the 50words application container | ||
npm run build:production | ||
docker build --push --rm \ | ||
-t ghcr.io/coedl/50words.online:latest . |
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,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ "$#" != "1" ] ; then | ||
echo "Usage: $0 [minor | patch]" | ||
exit -1 | ||
fi | ||
|
||
if [[ $1 != 'minor' && $1 != 'patch' ]] ; then | ||
echo "Usage: $0 [minor | patch]" | ||
exit -1 | ||
fi | ||
|
||
# version the code | ||
version=$(npm version --no-git-tag-version $1) | ||
git tag $version | ||
git commit -a -m "tag and bump version" | ||
|
||
# push it to github to trigger container builds | ||
git push origin master --tags |