Skip to content

change tag

change tag #2

Workflow file for this run

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Create Release
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Login to DigitalOcean
run: doctl registry login
- name: Build, tag, and push image to DigitalOcean
id: build-image
env:
ECR_REGISTRY: registry.digitalocean.com/nightingale-trading/web
run: |
IMAGE_TAG=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
# rename it to latest, that's what I use right now
IMAGE_TAG=screeners
echo "building $ECR_REGISTRY:${IMAGE_TAG}"
docker build -t $ECR_REGISTRY:${IMAGE_TAG} .
docker image ls
echo "pushing $ECR_REGISTRY:${IMAGE_TAG}"
docker push registry.digitalocean.com/nightingale-trading/web:${IMAGE_TAG}
echo "::set-output name=image::$ECR_REPOSITORY:${IMAGE_TAG}"
- name: Create Deployment
run: doctl apps create-deployment ${{ secrets.DO_APP_ID }}
- name: Kick off garbage collection
run: doctl registry garbage-collection start -f
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
${{ github.event.head_commit.message }}
draft: false
prerelease: false