-
Notifications
You must be signed in to change notification settings - Fork 235
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 #115 from JasonFreeberg/master
Add GitHub Actions workflows
- Loading branch information
Showing
4 changed files
with
91 additions
and
20 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,38 @@ | ||
name: Run tests on PRs and commits | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
workflow_dispatch: | ||
|
||
env: | ||
BOT_ID: 916ccfd76a7fda25c74d09e1d5 | ||
LEAGUE_ID: 164483 | ||
TEST_TAG: user/test_build:test | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Build container | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: false | ||
context: . | ||
load: true | ||
tags: ${{ env.TEST_TAG }} | ||
|
||
- name: Run image against tests | ||
run: docker run ${{ env.TEST_TAG }} python /usr/src/ff_bot/setup.py test |
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,52 @@ | ||
name: Publish image on commit or published release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
push-image: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ github.token }} | ||
|
||
- name: Set tag name for releases | ||
if: ${{ github.event_name == 'release' }} | ||
run: echo "TAG=ghcr.io/${GITHUB_REPOSITORY,,}:${GITHUB_REF##*/}" >>${GITHUB_ENV} | ||
|
||
- name: Set tag name for commits | ||
if: ${{ github.event_name == 'push' }} | ||
run: echo "TAG=ghcr.io/${GITHUB_REPOSITORY,,}:${{ github.sha }}" >>${GITHUB_ENV} | ||
|
||
- name: Build image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
load: true | ||
push: false | ||
tags: ${{ env.TAG }} | ||
|
||
- name: Test image | ||
run: docker run ${{ env.TAG }} python /usr/src/ff_bot/setup.py test | ||
|
||
- name: Push image to registry | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: ${{ env.TAG }} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM python:latest | ||
FROM python:3.9.9-slim-bullseye | ||
|
||
# Install app | ||
ADD . /usr/src/ff_bot | ||
|