Skip to content

Create Release V2

Create Release V2 #16

Workflow file for this run

name: Create Release V2
on:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: main
fetch-depth: 0
token: ${{ secrets.ACTION_RUNNER_TOKEN }}
- name: Configure Git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "Youtarr Service Account[bot]"
- name: Bump version and push tag
id: tag_version
uses: anothrNick/github-tag-action@v1
env:
GITHUB_TOKEN: ${{ secrets.ACTION_RUNNER_TOKEN }}
DEFAULT_BUMP: patch
WITH_V: true
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '16'
- name: Install server dependencies
run: npm ci
- name: Install client dependencies
run: |
cd client
npm ci
cd ..
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Update version in package.json
run: |
git config --global user.email "[email protected]"
git config --global user.name "Youtarr Service Account[bot]"
npm version ${{ steps.tag_version.outputs.new_tag }} --no-git-tag-version
cd client
npm version ${{ steps.tag_version.outputs.new_tag }} --no-git-tag-version
cd ..
git add package.json client/package.json
git commit -m "Bump version to ${{ steps.tag_version.outputs.new_tag }}"
git push
- name: Build and push Docker images
run: |
cd client
npm run build
cd ..
docker build -t ${{ vars.DOCKERHUB_USERNAME }}/youtarr:${{ steps.tag_version.outputs.new_tag }} .
docker push ${{ vars.DOCKERHUB_USERNAME }}/youtarr:${{ steps.tag_version.outputs.new_tag }}
docker tag ${{ vars.DOCKERHUB_USERNAME }}/youtarr:${{ steps.tag_version.outputs.new_tag }} ${{ vars.DOCKERHUB_USERNAME }}/youtarr:latest
docker push ${{ vars.DOCKERHUB_USERNAME }}/youtarr:latest