Skip to main content

One post tagged with "Github Actions"

View All Tags

· 2 min read

That is what I want to play with today!

Spoiler:


name: Deploy all target by pushing into main only
env:
CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }}
EXPLICIT_PUSH_BRANCH: main
IMPLICIT_DEPLOY_BRANCHES: "deploy-1 deploy-2 deploy-3"
on:
pull_request: # will be making explicitly
branches:
- ${{ env.CURRENT_BRANCH }}
push: # after PR these pushes will be triggered implicitly
branches: [deploy-1, deploy-2, deploy-3]
jobs:
general:
name: General for any workflow (branch)
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: show token // TODO rm
run: echo ${{ secrets.SUPER_GITHUB_TOKEN }}

- name: Clone repository
uses: actions/checkout@v4
with:
token: ${{ secrets.SUDO_GH_TOKEN }}

- name: Current branch
run: echo ${{ env.CURRENT_BRANCH }}

{/*