-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a build check for all pull requests to and automatically build and push the containerfile to the ghcr on all pushs to development and master. Other pipelines do not wait for the container to be pushed which means that they may have to be manually restarted if they fail due to an old container image.
- Loading branch information
Showing
4 changed files
with
72 additions
and
2 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
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,28 @@ | ||
name: Push container | ||
on: | ||
push: | ||
branches: | ||
- development | ||
- master | ||
paths: | ||
- '.devcontainer/Containerfile' | ||
|
||
jobs: | ||
push: | ||
name: Push container image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{secrets.TOKEN}} | ||
- name: 'Login to GitHub Container Registry' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{github.repository_owner}} | ||
password: ${{secrets.TOKEN}} | ||
- name: Build and push Docker image | ||
run: | | ||
docker build . -f ./.devcontainer/Containerfile -t ghcr.io/${{ github.repository_owner }}/7tv4wa-dev:${{ github.head_ref || github.ref_name }} -t ghcr.io/${{ github.repository_owner }}/7tv4wa-dev:latest | ||
docker push ghcr.io/${{ github.repository_owner }}/7tv4wa-dev --all-tags |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Build | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
|
||
jobs: | ||
build: | ||
name: Build APK | ||
runs-on: ubuntu-latest | ||
container: | ||
image: >- | ||
ghcr.io/${{ github.repository_owner }}/7tv4wa-dev:${{ | ||
(github.event_name == 'pull_request' && | ||
(github.event.pull_request.base.ref == 'development' || | ||
github.event.pull_request.base.ref == 'master')) && | ||
github.event.pull_request.base.ref || | ||
'latest' }} | ||
credentials: | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.TOKEN }} | ||
env: | ||
GITHUB_TOKEN: ${{secrets.TOKEN}} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
token: ${{secrets.TOKEN}} | ||
- name: Build apk | ||
run: chmod +x .github/workflows/*.sh && .github/workflows/build.sh |