ci(docker-publish): 确保仅在push事件时提交标签更新 (#22)
Some checks are pending
Docker Build and Publish / build (push) Waiting to run
Gitea Sync / trigger-gitea-sync (push) Waiting to run
Java CI with Maven / build (push) Waiting to run

* ci(docker-publish): 确保仅在push事件时提交标签更新

* refactor(github-workflows): 标准化Gitea Sync workflow名称

* feat(cors): 全局启用CORS支持

在Spring应用中通过配置CORS实现跨域请求支持,允许所有来源、方法和头。
此变更有助于解决前端应用在不同域上运行时的跨域问题。
This commit is contained in:
suyiiyii 2024-08-28 21:13:59 +08:00 committed by GitHub
parent 2c51b04381
commit b7afe430d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 25 additions and 1 deletions

View File

@ -113,6 +113,7 @@ jobs:
with:
cmd: yq eval '.image.tag = "${{ steps.meta.outputs.version }}"' -i values.yaml
- name: Git Auto Commit
if: github.event_name == 'push'
uses: stefanzweifel/git-auto-commit-action@v5.0.1
with:
commit_message: "Update deployment image to ${{ steps.meta.outputs.version }}"

View File

@ -1,4 +1,4 @@
name: gitea-sync.yml
name: Gitea Sync
on:
push:
branches: [ "main", "manifest" ]

View File

@ -0,0 +1,23 @@
package top.suyiiyii.sims.common;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class CorsConfig {
@Bean
public WebMvcConfigurer corsConfigurer() {
return new WebMvcConfigurer() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowedMethods("*")
.allowedHeaders("*");
}
};
}
}