Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
williammck committed Sep 3, 2023
0 parents commit 386d604
Show file tree
Hide file tree
Showing 3 changed files with 747 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build.yaml
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
Loading

0 comments on commit 386d604

Please sign in to comment.