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

use build_image workflow #352

Merged
merged 1 commit into from
Oct 20, 2024
Merged
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
41 changes: 15 additions & 26 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,54 +16,43 @@ permissions:

jobs:
golang_quality:
uses: CubicrootXYZ/Workflows/.github/workflows/[email protected].11
uses: CubicrootXYZ/Workflows/.github/workflows/[email protected].12

golang_test:
uses: CubicrootXYZ/Workflows/.github/workflows/[email protected].11
uses: CubicrootXYZ/Workflows/.github/workflows/[email protected].12
needs: [build_openapi_spec] # Validates agains OpenAPI spec
with:
services: '{"database": {"image": "mysql:9.0", "ports": ["3306:3306"], "env": {"MYSQL_ROOT_PASSWORD": "mypass", "MYSQL_DATABASE": "remindme"}}}'
env: '{"TEST_DB_HOST": "database"}'

build_openapi_spec:
uses: CubicrootXYZ/Workflows/.github/workflows/[email protected].11
uses: CubicrootXYZ/Workflows/.github/workflows/[email protected].12
with:
entrypoint: cmd/remindme/main.go

render_openapi_spec:
needs: [build_openapi_spec]
uses: CubicrootXYZ/Workflows/.github/workflows/[email protected].11
uses: CubicrootXYZ/Workflows/.github/workflows/[email protected].12
with:
spec_artifact_name: openapi-spec
spec_artifact_path: docs/
spec_filename: swagger.yaml

deploy_openapi_spec:
needs: [render_openapi_spec]
uses: CubicrootXYZ/Workflows/.github/workflows/[email protected].11
uses: CubicrootXYZ/Workflows/.github/workflows/[email protected].12
with:
artifact_name: rendered-api-docu
artifact_path: index.html

build_and_push_image:
build_image:
needs: [golang_test, golang_quality, render_openapi_spec]
runs-on: ubuntu-latest
if: "!startsWith(github.ref, 'refs/tags/')"
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Build container
run: docker build --build-arg VERSION=${{ github.sha }} -t cubicrootxyz/remindme:beta .
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push development image
if: "${{ github.ref != 'refs/heads/main' }}"
run: |
docker tag cubicrootxyz/remindme:beta cubicrootxyz/remindme:${{ github.sha }}
docker push cubicrootxyz/remindme:${{ github.sha }}
- name: Push beta image
if: "${{ github.ref == 'refs/heads/main' }}"
run: docker push cubicrootxyz/remindme:beta
uses: CubicrootXYZ/Workflows/.github/workflows/[email protected]
with:
docker_build_args: "--no-cache"
docker_file_path: "./"
image_name: "cubicrootxyz/remindme"
static_tag: "beta"
secrets:
dockerhub_user: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
25 changes: 0 additions & 25 deletions .github/workflows/release.yml

This file was deleted.

Loading