GitHub Actions is GitHub's native CI/CD platform that enables you to create, set up, and run workflows to automate builds, testing, deployment, and other tasks within the software lifecycle as well as reuse these workflows across repositories.
You can integrate both custom and public GitHub Actions available in the GitHub Marketplace into your SourceCraft CI/CD workflows.
Note
To work with GitHub Actions in SourceCraft, you do not need to create a GitHub account or use the GitHub interface.
Building a Docker image from the Dockerfile located at the repository root and pushing it to Cloud Registry using the Build and push Docker images GitHub Action.
tokens:# Token name (can be any).<token_name>:# Name of the service connection to Yandex Cloudservice_connection:<service_connection_name># Requested access scope:# org: All repositories# repo: Specific repository# ref: Branch or tagscope:repoworkflows:test-workflow:tasks:-name:test-gh-actions-taskcubes:# The cube exchanges the SourceCraft token for the Yandex Cloud IAM token# and saves it to the `IAM_TOKEN` variable within the `outputs` section.-name:get-iam-tokenenv:ID_TOKEN:${{tokens.<token_name>.id_token}}YC_SA_ID:${{tokens.<token_name>.service_account_id}}image:cr.yandex/sourcecraft/yc-iam:latest# The cube installs and configures the Docker Buildx utility.-name:setup-buildxaction:docker/setup-buildx-action@v3.11.1# The cube authenticates with Yandex Cloud Registry # using the IAM token.-name:loginaction:docker/login-action@v3.5.0with:registry:cr.yandex/<registry_ID>username:iam# Substitute to the `outputs` section the name of the IAM token cube,# e.g., `get-iam-token`.password:${{cubes.<IAM_token_cube_name>.outputs.IAM_TOKEN}}# The cube builds the Docker image from the Dockerfile and pushes it to the registry in# Cloud Registry.-name:build-and-pushaction:docker/build-push-action@v6.18.0with:context:.file:Dockerfileplatforms:linux/amd64tags:|
cr.yandex/<registry_ID>/image-name:latest
push:trueon:push:test-workflow
This CI process will start automatically after committing changes to the main branch.
Check the CI process:
Under CI/CD on the repository page, go to CI/CD.
Open a running workflow.
On the page that opens, you will see workflow tasks, cubes (task steps), as well as statuses and execution results.
In the Logs tab, expand the GitHub Actions cube and view its results.