Skip to content

Commit

Permalink
Test publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dariober committed May 23, 2024
1 parent 018ed1d commit c1362fb
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 29 deletions.
49 changes: 23 additions & 26 deletions .github/workflows/build-and-push-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,26 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Test
run: |
ls
# - name: Build and push Apollo CLI
# uses: docker/build-push-action@v5
# with:
# platforms: linux/arm64/v8,linux/amd64
# push: true
# tags: ghcr.io/gmod/apollo-cli:${{ inputs.tag }}
# context: packages/apollo-cli
# outputs:
# type=image,annotation-index.org.opencontainers.image.description=
# Apollo CLI
# cache-from: type=registry,ref=user/app:latest
# cache-to: type=inline
# - name: Build and push Apollo collaboration server image
# uses: docker/build-push-action@v5
# with:
# platforms: linux/arm64/v8,linux/amd64
# push: true
# tags: ghcr.io/gmod/apollo-collaboration-server:${{ inputs.tag }}
# outputs:
# type=image,annotation-index.org.opencontainers.image.description=Apollo
# collaboration server
# cache-from: type=registry,ref=user/app:latest
# cache-to: type=inline
- name: Build and push Apollo CLI
uses: docker/build-push-action@v5
with:
platforms: linux/arm64/v8,linux/amd64
push: false # true
tags: ghcr.io/gmod/apollo-cli:${{ inputs.tag }}
context: packages/apollo-cli
outputs:
type=image,annotation-index.org.opencontainers.image.description=
Apollo CLI
cache-from: type=registry,ref=user/app:latest
cache-to: type=inline
- name: Build and push Apollo collaboration server image
uses: docker/build-push-action@v5
with:
platforms: linux/arm64/v8,linux/amd64
push: false # true
tags: ghcr.io/gmod/apollo-collaboration-server:${{ inputs.tag }}
outputs:
type=image,annotation-index.org.opencontainers.image.description=Apollo
collaboration server
cache-from: type=registry,ref=user/app:latest
cache-to: type=inline
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish Apollo

on:
push:
# tags: 'v[0-9]'

env:
tag: devel

jobs:
publish-npm:
name: Publish to npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: yarn
registry-url: 'https://registry.npmjs.org'
scope: '@apollo-annotation'
- run: yarn --immutable
- run: |
yarn config set npmAuthToken ${{ secrets.NPM_TOKEN }}
yarn workspaces foreach --no-private --all npm publish --tolerate-republish --tag $tag
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-docker:
name: Build and push Docker image
uses: ./.github/workflows/build-and-push-docker.yml
with:
tag: $tag
6 changes: 3 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ jobs:
uses: ./.github/workflows/build-and-push-docker.yml
with:
tag: 'development'
#if:
# ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') ||
# inputs.publish }}
if:
${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') ||
inputs.publish }}
deploy:
name: Deploy to demo staging server
runs-on: ubuntu-latest
Expand Down

0 comments on commit c1362fb

Please sign in to comment.