-
Notifications
You must be signed in to change notification settings - Fork 8
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 #256 from freezingsaddles/github-actions-docker-build
- Loading branch information
Showing
6 changed files
with
125 additions
and
4 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,49 @@ | ||
--- | ||
name: Docker Build and Push | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
org: | ||
default: freezingsaddles | ||
description: 'Docker Hub organization' | ||
required: false | ||
type: string | ||
repo: | ||
default: freezing-web | ||
description: 'Docker Hub repository name' | ||
required: false | ||
type: string | ||
tag: | ||
default: latest | ||
description: 'tag for Docker container' | ||
required: false | ||
type: string | ||
secrets: | ||
DOCKERHUB_USERNAME: | ||
required: true | ||
DOCKERHUB_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
tags: ${{ inputs.org }}/${{ inputs.repo }}:${{ inputs.tag }} |
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,47 @@ | ||
--- | ||
name: Build Deploy and Test Latest | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
|
||
docker: | ||
uses: freezingsaddles/freezing-web/.github/workflows/[email protected] | ||
with: | ||
tag: latest | ||
secrets: inherit | ||
|
||
deploy-and-test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
|
||
- name: install | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.KEY }} | ||
port: ${{ secrets.PORT }} | ||
passphrase: ${{ secrets.PASSPHRASE }} | ||
script: | | ||
set -euo pipefail | ||
cd /opt/compose | ||
docker-compose pull freezing-web | ||
docker-compose up -d freezing-web | ||
- name: wait | ||
uses: iFaxity/[email protected] | ||
with: | ||
resource: https-get://freezingsaddles.org | ||
timeout: 5000 | ||
|
||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: test-wget-spider | ||
run: "URL=https://freezingsaddles.org test/wget-spider.sh" | ||
|
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,14 @@ | ||
--- | ||
name: Build Tag | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
docker: | ||
uses: freezingsaddles/freezing-web/.github/workflows/[email protected] | ||
with: | ||
tag: ${{ github.ref_name }} | ||
secrets: inherit |
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 @@ | ||
--- | ||
name: Build | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
docker: | ||
uses: freezingsaddles/freezing-web/.github/workflows/[email protected] | ||
with: | ||
tag: latest-actions-build | ||
secrets: inherit |
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