|
| 1 | +name: OromaminC Backend Service Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - release |
| 7 | + |
| 8 | +env: |
| 9 | + REGISTRY: ghcr.io |
| 10 | + IMAGE_NAME: ${{ github.repository }} |
| 11 | + |
| 12 | +jobs: |
| 13 | + |
| 14 | + tagging: |
| 15 | + name: 태깅 및 릴리즈 |
| 16 | + runs-on: ubuntu-latest |
| 17 | + outputs: |
| 18 | + tag_name: ${{ steps.tag_version.outputs.new_tag }} |
| 19 | + |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: versioning and tagging |
| 24 | + id: tag_version |
| 25 | + uses: mathieudutour/[email protected] |
| 26 | + with: |
| 27 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 28 | + |
| 29 | + - name: releasing |
| 30 | + uses: ncipollo/release-action@v1 |
| 31 | + with: |
| 32 | + tag: ${{ steps.tag_version.outputs.new_tag }} |
| 33 | + name: ${{ steps.tag_version.outputs.new_tag }} |
| 34 | + body: ${{ steps.tag_version.outputs.changelog }} |
| 35 | + |
| 36 | + build-image: |
| 37 | + name: 도커 이미지 빌드 |
| 38 | + runs-on: ubuntu-latest |
| 39 | + needs: tagging |
| 40 | + |
| 41 | + permissions: |
| 42 | + contents: read |
| 43 | + packages: write |
| 44 | + attestations: write |
| 45 | + id-token: write |
| 46 | + |
| 47 | + steps: |
| 48 | + - name: Check out Repository |
| 49 | + uses: actions/checkout@v4 |
| 50 | + |
| 51 | + - name: Setting for Developent |
| 52 | + run: echo "${{ secrets.APPLICATION_DEV_YML }}" > src/main/resources/application-dev.yml |
| 53 | + |
| 54 | + - name: Sign in github container registry |
| 55 | + uses: docker/login-action@v3 |
| 56 | + with: |
| 57 | + registry: ${{ env.REGISTRY }} |
| 58 | + username: ${{ github.actor }} |
| 59 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 60 | + |
| 61 | + - name: Extract metadata |
| 62 | + id: meta |
| 63 | + uses: docker/metadata-action@v5 |
| 64 | + with: |
| 65 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 66 | + tags: | |
| 67 | + type=sha |
| 68 | + type=raw,value=${{ needs.tagging.outputs.tag_name }} |
| 69 | + type=raw,value=latest |
| 70 | +
|
| 71 | + - name: Build and Push Image |
| 72 | + uses: docker/build-push-action@v6 |
| 73 | + with: |
| 74 | + context: . |
| 75 | + push: true |
| 76 | + tags: ${{ steps.meta.outputs.tags }} |
| 77 | + labels: ${{ steps.meta.outputs.labels }} |
0 commit comments