|
3 | 3 | release: |
4 | 4 | types: [published] |
5 | 5 | jobs: |
6 | | - push_to_registry: |
7 | | - name: Push Docker image to GitHub Packages |
8 | | - runs-on: ubuntu-latest |
9 | | - permissions: |
10 | | - packages: write |
11 | | - contents: read |
12 | | - steps: |
13 | | - - name: Check out the repo |
14 | | - uses: actions/checkout@v3 |
15 | | - - name: Login to GitHub Container Registry |
16 | | - uses: docker/login-action@v1 |
17 | | - with: |
18 | | - registry: ghcr.io |
19 | | - username: ${{ github.repository_owner }} |
20 | | - password: ${{ secrets.GITHUB_TOKEN }} |
21 | | - - name: Prepare |
22 | | - id: prep |
23 | | - run: | |
24 | | - DOCKER_IMAGE=ghcr.io/redocly/redoc/cli |
25 | | - VERSION=edge |
26 | | - if [[ $GITHUB_REF == refs/tags/* ]]; then |
27 | | - VERSION=${GITHUB_REF#refs/tags/} |
28 | | - elif [[ $GITHUB_REF == refs/heads/* ]]; then |
29 | | - VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g') |
30 | | - elif [[ $GITHUB_REF == refs/pull/* ]]; then |
31 | | - VERSION=pr-${{ github.event.number }} |
32 | | - fi |
33 | | - TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:latest" |
34 | | - if [ "${{ github.event_name }}" = "push" ]; then |
35 | | - TAGS="$TAGS,${DOCKER_IMAGE}:sha-${GITHUB_SHA::8}" |
36 | | - fi |
37 | | - echo ::set-output name=version::${VERSION} |
38 | | - echo ::set-output name=tags::${TAGS} |
39 | | - echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') |
40 | | - - name: Push to GitHub Packages |
41 | | - uses: docker/build-push-action@v3 |
42 | | - with: |
43 | | - context: ./cli |
44 | | - push: ${{ github.event_name != 'pull_request' }} |
45 | | - tags: ${{ steps.prep.outputs.tags }} |
| 6 | + # push_to_registry: |
| 7 | + # name: Push Docker image to GitHub Packages |
| 8 | + # runs-on: ubuntu-latest |
| 9 | + # permissions: |
| 10 | + # packages: write |
| 11 | + # contents: read |
| 12 | + # steps: |
| 13 | + # - name: Check out the repo |
| 14 | + # uses: actions/checkout@v3 |
| 15 | + # - name: Login to GitHub Container Registry |
| 16 | + # uses: docker/login-action@v1 |
| 17 | + # with: |
| 18 | + # registry: ghcr.io |
| 19 | + # username: ${{ github.repository_owner }} |
| 20 | + # password: ${{ secrets.GITHUB_TOKEN }} |
| 21 | + # - name: Prepare |
| 22 | + # id: prep |
| 23 | + # run: | |
| 24 | + # DOCKER_IMAGE=ghcr.io/redocly/redoc/cli |
| 25 | + # VERSION=edge |
| 26 | + # if [[ $GITHUB_REF == refs/tags/* ]]; then |
| 27 | + # VERSION=${GITHUB_REF#refs/tags/} |
| 28 | + # elif [[ $GITHUB_REF == refs/heads/* ]]; then |
| 29 | + # VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g') |
| 30 | + # elif [[ $GITHUB_REF == refs/pull/* ]]; then |
| 31 | + # VERSION=pr-${{ github.event.number }} |
| 32 | + # fi |
| 33 | + # TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:latest" |
| 34 | + # if [ "${{ github.event_name }}" = "push" ]; then |
| 35 | + # TAGS="$TAGS,${DOCKER_IMAGE}:sha-${GITHUB_SHA::8}" |
| 36 | + # fi |
| 37 | + # echo ::set-output name=version::${VERSION} |
| 38 | + # echo ::set-output name=tags::${TAGS} |
| 39 | + # echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') |
| 40 | + # - name: Push to GitHub Packages |
| 41 | + # uses: docker/build-push-action@v3 |
| 42 | + # with: |
| 43 | + # context: ./cli |
| 44 | + # push: ${{ github.event_name != 'pull_request' }} |
| 45 | + # tags: ${{ steps.prep.outputs.tags }} |
46 | 46 | dockerhub: |
47 | 47 | name: Publish redoc image to DockerHub |
48 | 48 | runs-on: ubuntu-latest |
|
0 commit comments