Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test image #703

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 27 additions & 25 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: publish 🐳 Docker image

on:
push:
tags:
- "v*"
on: push
#on:
# push:
# tags:
# - "v*"

env:
TEST_TAG: voxpupuli/puppetboard:test

jobs:

Expand All @@ -17,13 +21,13 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand All @@ -43,30 +47,28 @@ jobs:
# full version
tags.add(f"{image}:{version}")

if not parse(version).is_prerelease:
# only final and post-releases should get the tags
# used for automatic use of latest *stable* version

# major_version
major_version = re.search(r'(\d+?)\.', version).group(1)
tags.add(f"{image}:{major_version}")

# major_version.minor_version
major_and_minor_version = re.search(r'(\d+?\.\d+?)\.', version).group(1)
tags.add(f"{image}:{major_and_minor_version}")

tags.add(f"{image}:latest")

tags = ",".join(sorted(list(tags)))

print(f"::set-output name=tags::{tags}")

id: tags

- name: Build and push
uses: docker/build-push-action@v2
- name: Build the image with test tag
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.tags.outputs.tags }}
load: true
tags: ${{ env.TEST_TAG }}

- name: Test the image
run: |
docker run --rm ${{ env.TEST_TAG }}

# - name: Build image with final tags and push
# uses: docker/build-push-action@v3
# with:
# context: .
# platforms: linux/amd64
# push: true
# tags: ${{ steps.tags.outputs.tags }}
78 changes: 39 additions & 39 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
name: publish 🐍 egg to PyPI

on:
push:
tags:
- "v*"

jobs:
build-n-publish:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install wheel
- name: Build
run: |
python setup.py build sdist bdist_wheel
- name: Publish distribution 📦 to PyPI
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_API_TOKEN_PUPPETBOARD }}
# repository_url: https://test.pypi.org/legacy/
- name: Create release in GitHub
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
#name: publish 🐍 egg to PyPI
#
#on:
# push:
# tags:
# - "v*"
#
#jobs:
# build-n-publish:
#
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python 3.10
# uses: actions/setup-python@v2
# with:
# python-version: '3.10'
# - name: Install dependencies
# run: |
# pip install wheel
# - name: Build
# run: |
# python setup.py build sdist bdist_wheel
# - name: Publish distribution 📦 to PyPI
# uses: pypa/[email protected]
# with:
# password: ${{ secrets.PYPI_API_TOKEN_PUPPETBOARD }}
# # repository_url: https://test.pypi.org/legacy/
# - name: Create release in GitHub
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
# with:
# tag_name: ${{ github.ref }}
# release_name: ${{ github.ref }}
# draft: false
# prerelease: false