Skip to content

Bump actions/checkout from 3 to 4 (#5123) #690

Bump actions/checkout from 3 to 4 (#5123)

Bump actions/checkout from 3 to 4 (#5123) #690

# N.B.: This won't run on releases because of
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow.
# However, we also have a companion deploy that's part of the release.yml workflow.
name: Companion Edge Deploy
on:
push:
branches: ['main']
paths:
- yarn.lock
- 'packages/@uppy/companion/**'
- '.github/workflows/companion-deploy.yml'
env:
YARN_ENABLE_GLOBAL_CACHE: false
jobs:
npm:
name: Generate npm tarball
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set SHA commit in version
run:
(cd packages/@uppy/companion && node -e 'const
pkg=require("./package.json");pkg.version+="+${{ github.sha
}}";fs.writeFileSync("package.json",JSON.stringify(pkg, undefined,
2)+"\n")')
- name: Create Companion tarball
run:
corepack yarn workspace @uppy/companion pack --install-if-needed -o
/tmp/companion-${{ github.sha }}.tar.gz
- name: Upload artifact
if: success()
uses: actions/upload-artifact@v4
with:
name: companion-${{ github.sha }}.tar.gz
path: /tmp/companion-${{ github.sha }}.tar.gz
docker:
name: DockerHub
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 0
COMPOSE_DOCKER_CLI_BUILD: 0
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
with:
images: transloadit/companion
tags: |
type=edge
type=raw,value=latest,enable=false
- uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- uses: docker/setup-buildx-action@v2
- name: Log in to DockerHub
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_PASSWORD}}
- name: Build and push
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
push: true
context: .
platforms: linux/amd64,linux/arm64
file: Dockerfile
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
heroku:
name: Heroku
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Alter dockerfile
run: |
sed -i 's/^EXPOSE 3020$/EXPOSE $PORT/g' Dockerfile
- name: Deploy to heroku
uses: akhileshns/heroku-deploy@581dd286c962b6972d427fcf8980f60755c15520 # v3.13.15
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: companion-demo
heroku_email: ${{secrets.HEROKU_EMAIL}}
usedocker: true