tencent cloud

Tencent Cloud Elastic Microservice

Release Notes and Announcements
Announcements
Release Notes
Product Introduction
Overview
Strengths
Scenarios
Purchase Guide
Billing Overview
Product Pricing
Overdue Policies
Getting Started
Step 1. Get the Access Permission
Step 2. Create an Environment
Step 3. Create an Application
Step 4. Deploy the Application
Operation Guide
Environment Management
Application Management
Permission Management
View Change Record
Practical Tutorial
Use of GitHub Actions in TEM
Hosting a Static Website
Public Network Access of TEM Applications
TEM Application Access to Public Network (Through API Gateway)
TEM Application Failure Troubleshooting Guide
Quick Access to TEM Application Through API Gateway
Java Application Fine-Tuning
Migration from Java 8 to Java 11
API Documentation
History
Introduction
API Category
Making API Requests
Environment APIs
ModifyIngress
Resource APIs
Application APIs
Service APIs
RollingUpdateApplicationByVersion
Access Policy APIs
Configuration file APIs
Log collecting APIs
Scaling Rule APIs
Application Version APIs
Other APIs
Workload APIs
Data Types
Error Codes
FAQs
TEM Configuration
Contact Us
Glossary
TEM Policy
Privacy Policy
Data Privacy and Security Agreement

Use of GitHub Actions in TEM

PDF
Focus Mode
Font Size
Last updated: 2024-01-09 12:42:59

Use of GitHub Actions in TEM

GitHub Actions

TEM integrates world-class CI/CD tools to facilitate your use of GitHub workflows. You can learn more by referring to the official documentation of GitHub Actions.
Note:
GitHub Actions makes it easy to automate all your software workflows, now with world-class CI/CD.

Application release types supported by TEM

The TEM platform uses cloud native as its infrastructure, where all applications exist in the form of containers at runtime. TEM especially supports the release of JAR and WAR packages for Java applications and takes care of the build and management of images. For other languages, you need to build images on your own and push them to Tencent Cloud Image Registry.

How to use

The following takes .NET as an example to describe how to use GitHub Actions.
name: .NET

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Declare some variables
id: vars
shell: bash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Build Code
run: dotnet publish -o ./target
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Registry
uses: docker/login-action@v1
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ccr.ccs.tencentyun.com/han_test/my-web-app:${{ steps.vars.outputs.sha_short }}
1. Your code repository should include the dockerfile file for use by the built action.
FROM mcr.microsoft.com/dotnet/aspnet:5.0
COPY ./target /app
WORKDIR /app
ENTRYPOINT ["dotnet", "myWebApp.dll"]
2. Here, commitId is used as the image tag, which makes it easier to confirm the runtime's application code version. If you don't need this, you can directly use the latest image tag.
git rev-parse --short HEAD
3. Tencent Cloud Image Registry Personal Edition requires your login information. The account information will automatically pop up when you open the Personal Edition page for the first time. The Enterprise Edition works in a similar way. You can find relevant documents by yourself.
- name: Login to Registry
uses: docker/login-action@v1
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
4. Relevant keys can be managed by using the Secrets module on the Repository Settings page.



Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback