Switch to new upbound devex #23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: {} | |
workflow_dispatch: | |
inputs: | |
version: | |
description: Package version (e.g. v0.1.0) | |
required: false | |
env: | |
UP_API_TOKEN: ${{ secrets.UP_API_TOKEN }} | |
UP_ROBOT_ID: ${{ secrets.UP_ROBOT_ID }} | |
UP_ORG: ${{ secrets.UP_ORG }} | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
id: checkout | |
uses: actions/checkout@v4 | |
- name: Install and login with up | |
if: env.UP_API_TOKEN != '' && env.UP_ORG != '' | |
uses: upbound/action-up@v1 | |
with: | |
api-token: ${{ secrets.UP_API_TOKEN }} | |
organization: ${{ secrets.UP_ORG }} | |
# doesn't work with plain token when pushing otherwise | |
- name: Login to xpkg with robot | |
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3 | |
with: | |
registry: xpkg.upbound.io | |
username: ${{ env.UP_ROBOT_ID }} | |
password: ${{ env.UP_API_TOKEN }} | |
- name: Build and Push Upbound project | |
if: env.UP_API_TOKEN != '' | |
uses: upbound/action-up-project@v1 | |
with: | |
push-project: true | |
tag: ${{ inputs.version || '' }} | |
# login-check does `up org list` which doesn't work with a robot-token | |
skip-login-check: true |