Skip to content

Commit

Permalink
Merge pull request #13 from Marukome0743/main
Browse files Browse the repository at this point in the history
Add deploy-ghcr.yml
  • Loading branch information
Marukome0743 authored Nov 9, 2023
2 parents e9893b9 + 1222f07 commit f134f83
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/deploy-ghcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: CI to GitHub Packages

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches: [ "main" ]
paths:
- "app/**"
- "public/**"
- "next.config.js"
- "package.json"
- "postcss.config.js"
- "tailwind.config.ts"
- "tsconfig.json"
- "yarn.lock"
pull_request:
branches: [ "main" ]
paths:
- "app/**"
- "public/**"
- "next.config.js"
- "package.json"
- "postcss.config.js"
- "tailwind.config.ts"
- "tsconfig.json"
- "yarn.lock"
workflow_dispatch:

jobs:
build:
name: deploy
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: openup/rasnage:latest
cache-from: type=registry,ref=openup/rasnage:latest
cache-to: type=inline

- name: Comment on PR
if: steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: test-failures-${{ github.workflow }}
message: |
❌ @${{ github.actor }} ${{ steps.test.outputs.failing_tests_count }} files with test failures on ${{ github.workflow }}:
${{ steps.test.outputs.failing_tests }}
**[View test output](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})**
<sup>[#${{ github.sha }}](https://github.com/${{ github.repository }}/commits/${{ github.sha }})</sup>
- name: Uncomment on PR
if: steps.test.outputs.failing_tests == '' && github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: test-failures-${{ github.workflow }}
mode: upsert
create_if_not_exists: false
message: |
✅ test failures on ${{ github.workflow }} have been resolved.
<sup>[#${{ github.sha }}](https://github.com/${{ github.repository }}/commits/${{ github.sha }})</sup>

0 comments on commit f134f83

Please sign in to comment.