-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add ci workflow * update settings * Fix missing deps * fixes linting issue * Remove " * bash error * fix condition and push * Add actions badge * retire azure devops * remove gitversion config * Update image repos * add alt text * 🐳 * Update with note on ghcr move * add extra check to push
- Loading branch information
Showing
10 changed files
with
96 additions
and
87 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,86 @@ | ||
name: status-cake-exporter | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
IMAGE_NAME: status-cake-exporter | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python 🐍 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install Dependencies 🚧 | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements-dev.txt | ||
- name: Lint 🍻 | ||
run: | | ||
python -m flake8 exporter/ --max-line-length=120 --tee | ||
# - name: Test ✅ | ||
# run: | | ||
# python setup.py test | ||
|
||
- name: Build image 🐳 | ||
run: docker build . --file Dockerfile --tag status-cake-exporter | ||
|
||
- name: Log into registry 🐳 | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
||
- name: Push image 🐳 | ||
run: | | ||
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME | ||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | ||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | ||
if [[ "${{ github.ref }}" == "refs/tags/v"* ]]; then | ||
docker tag $IMAGE_NAME $IMAGE_ID:$(echo $VERSION | sed -e 's/^v//') | ||
# latest should always reflect the most recent tagged release | ||
VERSION=latest | ||
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | ||
# main represents the latest build from main branch | ||
VERSION=main | ||
else | ||
# dev represents the latest build from prs or branches | ||
VERSION=dev | ||
fi | ||
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION | ||
docker push -a $IMAGE_ID | ||
env: | ||
GITVERSION_MAJORMINORPATCH: ${{ steps.gitversion.outputs.majorMinorPatch }} | ||
|
||
- name: Build Changelog 📝 | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
id: build_changelog | ||
uses: mikepenz/release-changelog-builder-action@v1 | ||
with: | ||
configuration: "changelog.json" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create Release 🚀 | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
id: create_release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
name: status-cake-exporter | ||
body: ${{steps.build_changelog.outputs.changelog}} | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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,6 +1,4 @@ | ||
{ | ||
"python.pythonPath": "env/bin/python3", | ||
"python.linting.enabled": true, | ||
"python.linting.pylintEnabled": false, | ||
"python.linting.flake8Enabled": true | ||
} |
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
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
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
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 @@ | ||
flake8==3.7.8 |
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,6 +1,5 @@ | ||
prometheus-client==0.7.1 | ||
requests==2.22.0 | ||
flake8==3.7.8 | ||
ConfigArgParse==0.14.0 | ||
|
||
|