To access the OpenFaaS gateway from a workflow you should adapt the workflow to:
Fetch a GitHub Actions id_token
Authenticate to OpenFaaS with the id_token using the faas-cli pro plugin.
This is an example of a workflow file:
name:federateon:workflow_dispatch:push:branches:-'*'jobs:auth:# Add "id-token" with the intended permissions.permissions:contents:'read'id-token:'write'runs-on:ubuntu-lateststeps:-uses:actions/checkout@masterwith:fetch-depth:1-name:Dump envrun:env-name:Install faas-clirun:curl -sLS https://cli.openfaas.com | sudo sh-name:Get token and use the CLIrun:|export OPENFAAS_URL="https://gw.example.com"OIDC_TOKEN=$(curl -sLS "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=$OPENFAAS_URL" -H "User-Agent: actions/oidc-client" -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN")JWT=$(echo $OIDC_TOKEN | jq -j '.value')faas-cli plugin get profaas-cli pro enablefaas-cli pro auth --token=$JWTfaas-cli list -n devfaas-cli nsfaas-cli store deploy -n dev printer --name p1
First a GitHub Actions id_token is fetched. The workflow uses the faas-cli pro plugin to authenticate to the OpenFaaS gateway using the GitHub Actions id_token. It will exchange the token for an OpenFaaS token and save it. Next the faas-cli can be used to talk to the gateway.