This repository has been archived by the owner on Feb 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from silinternational/feature/use-github-actions
Use GitHub actions
- Loading branch information
Showing
8 changed files
with
115 additions
and
149 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,39 @@ | ||
name: Test and Publish | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
test-app: | ||
name: Test App | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Run tests | ||
run: docker-compose -f docker-compose.test.yml run --rm test ./run-tests.sh | ||
|
||
build-and-publish: | ||
name: Build and Publish | ||
needs: test-app | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ vars.DOCKER_ORG }}/auth-proxy | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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 |
---|---|---|
|
@@ -14,7 +14,6 @@ caddy | |
|
||
# Local env files | ||
*.env | ||
!test.env | ||
!*example.env | ||
|
||
# Other files | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,73 @@ | ||
version: "3.7" | ||
|
||
# Use extension fields, see https://docs.docker.com/compose/compose-file/11-extension/ | ||
x-common-variables: &test-variables | ||
HOST: http://testapp | ||
COOKIE_NAME: _proxy | ||
TOKEN_SECRET: Rm9yIEdvZCBzbyBsb3ZlZCB0aGUgd29ybGQgdGhhdCBoZSBnYXZlIGhpcyBvbmUgYW5kIG9ubHkgU29uLCB0aGF0IHdob2V2ZXIgYmVsaWV2ZXMgaW4gaGltIHNoYWxsIG5vdCBwZXJpc2ggYnV0IGhhdmUgZXRlcm5hbCBsaWZlLiAtIEpvaG4gMzoxNg== | ||
SITES: one:server1:80,two:server2:80,three:server3:80 | ||
MANAGEMENT_API: http://fakemanagementapi:80 | ||
|
||
services: | ||
testapp: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile-dev | ||
ports: | ||
- "53063:80" | ||
environment: *test-variables | ||
volumes: | ||
- ./:/app | ||
|
||
test: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile-test | ||
depends_on: | ||
- testapp | ||
- fakemanagementapi | ||
- server1 | ||
- server2 | ||
- server3 | ||
environment: *test-variables | ||
volumes: | ||
- .:/src | ||
- go-build:/root/.cache/go-build | ||
- go-mod:/go/pkg/mod | ||
working_dir: /src | ||
|
||
fakemanagementapi: | ||
image: caddy:2 | ||
environment: | ||
SERVER: API | ||
volumes: | ||
- ./Caddyfile-test:/srv/Caddyfile | ||
command: caddy run | ||
|
||
server1: | ||
image: caddy:2 | ||
environment: | ||
SERVER: server1 | ||
volumes: | ||
- ./Caddyfile-test:/srv/Caddyfile | ||
command: caddy run | ||
|
||
server2: | ||
image: caddy:2 | ||
environment: | ||
SERVER: server2 | ||
volumes: | ||
- ./Caddyfile-test:/srv/Caddyfile | ||
command: caddy run | ||
|
||
server3: | ||
image: caddy:2 | ||
environment: | ||
SERVER: server3 | ||
volumes: | ||
- ./Caddyfile-test:/srv/Caddyfile | ||
command: caddy run | ||
|
||
volumes: | ||
go-build: {} | ||
go-mod: {} |
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 was deleted.
Oops, something went wrong.