Skip to content

Commit

Permalink
add ci job for tag
Browse files Browse the repository at this point in the history
  • Loading branch information
BeryJu committed May 6, 2023
1 parent 1422f81 commit a614e16
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 20 deletions.
39 changes: 19 additions & 20 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,28 @@ name: ci-build

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:

build:
runs-on: ubuntu-latest
steps:
- 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: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v4.0.0
with:
tags: ghcr.io/beryju/oauth1-test-server:latest
push: ${{ github.ref == 'refs/heads/master' }}
platforms: linux/amd64,linux/arm64
- 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: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v4.0.0
with:
tags: ghcr.io/beryju/oauth1-test-server:latest
push: ${{ github.ref == 'refs/heads/master' }}
platforms: linux/amd64,linux/arm64
27 changes: 27 additions & 0 deletions .github/workflows/ci-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: ci-tag

on:
push:
tags:
- v*

jobs:
build:
runs-on: ubuntu-latest
steps:
- 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: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v4.0.0
with:
tags: ghcr.io/beryju/oauth1-test-server:${{github.ref_name}}
platforms: linux/amd64,linux/arm64

0 comments on commit a614e16

Please sign in to comment.