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

ci: autogenerate release #269

Closed
wants to merge 17 commits into from
42 changes: 39 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ permissions:
jobs:
Release:
runs-on: ubuntu-latest
# don't allow for publishing release unless everything else passes
# TODO: not sure if this will work
# needs: [Build, Prettier, Unit-Tests, E2E-Tests, Dockerfile-Lint, ESLint, Type-Check]
steps:
# get the version of the current git tag
- name: Get tag version
Expand All @@ -30,3 +27,42 @@ jobs:
# generate release name with the tag name that was just pushed
humphd marked this conversation as resolved.
Show resolved Hide resolved
automatic_release_tag: ${{ steps.vars.outputs.tag }}
prerelease: false
Docker-Build:
# We'll only build and push when landing on main, not for PRs
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this, since we'll never run this in response to a PR, right (only on tag)?

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

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

- name: Extract Docker metadata from git info
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/DevelopingSpace/starchart
flavor: latest=true
tags: |
type=semver,value=${{ steps.vars.outputs.tag }}
- name: Log in to the GitHub Container Registry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blank line in between all steps, or none, but be consistent.

uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}