-
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
0 parents
commit 386d604
Showing
3 changed files
with
747 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,62 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
postgres: | ||
image: postgres:15.4 | ||
env: | ||
POSTGRES_USER: discourse | ||
POSTGRES_PASSWORD: discourse | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
redis: | ||
image: redis:7.2 | ||
options: >- | ||
--health-cmd "redis-cli ping" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Checkout discourse_docker | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: discourse/discourse_docker | ||
path: discourse_docker | ||
|
||
- name: Copy container definition | ||
run: cp web_only.yml discourse_docker/containers/web_only.yml | ||
|
||
- name: Build container | ||
run: | | ||
NETWORK_ID=$(docker network ls --filter=name=github_network_ --format="{{.ID}}") | ||
discourse_docker/launcher bootstrap web_only --docker-args "--network=$NETWORK_ID" | ||
- name: Login to DigitalOcean Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: registry.digitalocean.com | ||
username: ${{ secrets.DO_REGISTRY_USERNAME }} | ||
password: ${{ secrets.DO_REGISTRY_USERNAME }} | ||
|
||
- name: Push image | ||
run: | | ||
TAG=$(echo $GITHUB_RUN_ID$GITHUB_RUN_ATTEMPT | sha256sum | head -c8) | ||
SOURCE_IMAGE=local_discourse/web_only:latest | ||
TARGET_IMAGE=registry.digitalocean.com/vatsim-containers/discourse:$TAG | ||
docker tag $SOURCE_IMAGE $TARGET_IMAGE | ||
docker push $TARGET_IMAGE |
Oops, something went wrong.