Skip to content

Build and push resourcely-cli Docker image #18

Build and push resourcely-cli Docker image

Build and push resourcely-cli Docker image #18

name: Build and push resourcely-cli Docker image
on:
# push:
# branches: [ main ]
workflow_dispatch:
inputs:
tag:
description: 'Docker image tag (default is: latest)'
required: true
default: 'latest'
type: choice
options:
- latest
- dev
env:
IMAGE_NAME_CLI: ghcr.io/resourcely-inc/resourcely-cli:${{ inputs.tag }}
permissions: write-all
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
# Build and push resourcely-cli
- name: Checkout resourcely-cli code
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
repository: Resourcely-Inc/resourcely-cli
ref: main
path: resourcely-cli
- name: Build resourcely-cli Docker image
run: |
docker build -t $IMAGE_NAME_CLI --build-arg="GH_ACCESS_TOKEN=${{ secrets.GH_ACCESS_TOKEN }}" resourcely-cli
docker images # for debugging purposes
# Login and push resourcely-cli image
- name: Login to Github Container Registry
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push resourcely-cli Docker Image to Github Container Registry
run: docker push $IMAGE_NAME_CLI